SocketTools .NET Edition

SshClient.Disconnect Method 

Terminate the connection with a remote host.

[Visual Basic]
Public Sub Disconnect()
[C#]
public void Disconnect();

Remarks

The Disconnect method terminates the connection with the remote host and releases the client handle allocated by the class. Note that the client socket is not immediately released when the connection is terminated and will enter a wait state for two minutes. After the time wait period has elapsed, the client will be released by the operating system. This is a normal safety mechanism to handle any packets that may arrive after the connection has been closed.

The value of the ExitCode property is updated when the Disconnect method is called. This enables an application to check the exit code returned by the shell or program that was executed on the server. In most cases, an exit code value of zero indicates success, while any other value indicates an error condition.

See Also

SshClient Class | SocketTools Namespace