Back to product page

Connect


Connects to the remote server.

Type

None

Syntax

  • Basic
object.Connect [Hostname], [Port], [Protocol]
The Connect(object,Hostname,Port,Protocol) syntax has these parts:
objectAn expression evaluating to an object of type wodTunnel.
HostnameOptional. A Variant value. Holds the name or IP address of the server.
PortOptional. A Variant value. Holds the port on the remote server to connect to.
ProtocolOptional. A Variant value. Determines the protocol version to be used, as defined by the ProtocolsEnum.

Remarks

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

If an error occurs whilst connecting, the Connected event will be fired with ErrorCode set to the error that occurred. If ErrorCode is set to 0, wodSSHTunnel successfully connected with the remote server.

Upon connection, wodSSHTunnel may perform an initial 'handshake' with the remote server (it will negotiate encryption algorithms and other properties relating to a secured connection.) If you see your modem lamps flashing but you have not received the Connected event yet, this is normal. It is because wodSSHTunnel has connected and is transmitting/receiving packets as part of this negotiation. After the handshake is completed, wodSSHTunnel may also perform automatic authentication with the server. All of this will happen internally prior to the Connected event firing!

After the Connected event has fired, you can Start any channel for which you want to do port forwarding and immediately after that you can accept connections.

Platforms

Windows