<PackageReference Include="SSH.NET" Version="2013.1.27" />

BaseClient

public abstract class BaseClient : IDisposable
Serves as base class for client implementations, provides common client functionality.

Gets the connection info.

public bool IsConnected { get; }

Gets a value indicating whether this client is connected to the server.

public TimeSpan KeepAliveInterval { get; set; }

Gets or sets the keep alive interval in seconds.

protected Session Session { get; }

Gets current session.

Occurs when an error occurred.

Occurs when host key received.

public BaseClient(ConnectionInfo connectionInfo)

Initializes a new instance of the BaseClient class.

public void Connect()

Connects client to the server.

public void Disconnect()

Disconnects client from the server.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged ResourceMessages.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources

protected virtual void OnConnected()

Called when client is connected to the server.

protected virtual void OnConnecting()

Called when client is connecting to the server.

protected virtual void OnDisconnected()

Called when client is disconnected from the server.

protected virtual void OnDisconnecting()

Called when client is disconnecting from the server.

public void SendKeepAlive()

Sends keep-alive message to the server.