Back to product page

Connect method


Connects to the server.

Type

Void

Syntax

  • C#
  • VB.NET
public Void Connect();

public Void Connect(String Hostname);
The Connect(Hostname) syntax has these parts:
HostnameHostname of the server.

public Void Connect(String Hostname, Int16 Port);
The Connect(Hostname,Port) syntax has these parts:
HostnameHostname of the server.
PortPort on the server where we will connect.

public Sub Connect()

public Sub Connect(ByVal Hostname As String)
The Connect(Hostname) syntax has these parts:
HostnameHostname of the server.

public Sub Connect(ByVal Hostname As String, ByVal Port As Int16)
The Connect(Hostname,Port) syntax has these parts:
HostnameHostname of the server.
PortPort on the server where we will connect.

Remarks

Connect method will initiate connection between wodSSH.NET and the remote server. It can be used only if wodSSH.NET is not connected with the server at the same moment (in other words, if State is set to Disconnected).

If an error occurs during connection, SocketException will be thrown describing the error. If no error occurs, Connected event will be fired.

Upon connection, wodSSH.NET may perform initial 'handshake' with remote server, depending on protocol selected. It will negotiate encryption algorithms and other properties related to secured connection.

After handshake is completed, wodSSH.NET will perform automatic authentication with server.
Optionally, if Command property is set, wodSSH.NET will send specified command, wait for an answer from server, and disconnect automatically. If Command property is empty (default), wodSSH.NET will open shell on remote server and it will allow you to send/receive data.

Platforms

Windows