OnConnect Event does not fire as expected - WeOnlyDo Discussion board

OnConnect Event does not fire as expected (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Bernhard K, Monday, June 18, 2018, 16:07 (2101 days ago)

Hi,
I am currently evaluating the ActiveX WodSFTP component with Embarcadero Delphi. So far everything seems ok, but I have a big problem:
If I do a SFTP.connect to an invalid FQDN or if that server is down or if I am offline, the component does not fire the OnConnected event as stated in the manual:
"If an error occurs during connection, the Connected event will be fired with ErrorCode set to the error that occurred"

Now my question is: on what cases is the OnConnected event triggered with an error?

Regards, Bernhard

OnConnect Event does not fire as expected

by Jasmine, Monday, June 18, 2018, 16:10 (2101 days ago) @ Bernhard K

Hi Bernhard,

Did you check if Connect method returned the error? If it did, connection did not even start, so Connected or Disconnected events do not fire. This especially happens when host cannot be resolved.

Kind regards,
Jasmine

OnConnect Event does not fire as expected

by Bernhard K, Tuesday, June 19, 2018, 13:53 (2100 days ago) @ Jasmine

Ok, I got it, thank you!
So if I connect to a non-existing host the OnConnect-Event is not triggered, instead the Connect Method raises an execption.
This is ok, I just have to avoid any modal error boxes, since the component will be used in a Service...

OnConnect Event does not fire as expected

by Jasmine, Tuesday, June 19, 2018, 14:10 (2100 days ago) @ Bernhard K

Hi Bernhard,

Component does not show messageboxes, but your wrapper could for unhandled errors. I think Delphi does that.

Basically any method could return such exception. For instance PutFile can return error if local file does not exist.

Jasmine