Connect - Invalid host name - WeOnlyDo Discussion board

Connect - Invalid host name (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Iulian, Monday, April 10, 2006, 11:04 (6616 days ago)


Hi,

I have a problem with wodSFTP ActiveX component (registered) used in Delphi. The issue occurs when trying to connect to an invalid host (e.g. Hostname='some_bad_host' - not IP address).
As the component documentation says, I expected to get an error code in Connected event, as the documentation says: If an error occurs during connection, the Connected event will be fired with ErrorCode set to the error that occurred. But in this case, the Connected event is not fired. Instead, an exception occurs, with message: Host not found!
This is an particular behavior. For other exception situation, the component acts like described.

Please let me know

Thanks,
Iulian

Re: Connect - Invalid host name

by wodSupport, Monday, April 10, 2006, 12:23 (6616 days ago) @ Iulian

Iulian,

this is by design - component didn't start the connection at all since it cannot resolve the hostname. So, you must add the code to catch the exception.

Similar thing is in, for example, PutFile when local file doesn't exist - exception will be thrown (well, it is visible as exception in Delphi) instead of Done event. That's because internal protocol didn't even start - since error occurred much sooner.

Hope I helped.
Kreso