Back to product page

Connect method


Connects to the remote server.

Type

None

Syntax

  • Basic
object.Connect [Hostname], [Port]
The Connect(object,Hostname,Port) syntax has these parts:
objectAn expression evaluating to an object of type wodSFTP.
HostnameOptional. A Variant value. Specifies hostname or IP address of the server.
PortOptional. A Variant value. Specifies port on the server.

Remarks

The Connect method will initiate a connection between wodSFTP and the remote server. It can be used only if wodSFTP is not connected with a server at the time of the call (in other words, if State is set to Disconnected).

If an error occurs during connection, the Connected event will be fired with ErrorCode set to the error that occurred. If ErrorCode is set to 0, then wodSFTP successfully connected with the remote server.

Upon connection, wodSFTP may perform an initial 'handshake' with the remote server (it will negotiate encryption algorithms and other properties related to a secure connection.) There is no need to be concerned if you see network activity but you don't get a Connected event immediately. This happens because wodSFTP has connected and is transmitting/receiving packets as part of the 'handshake' negotiation.

After the handshake is completed, wodSFTP may perform automatic authentication with the server.

Platforms

Windows