<PackageReference Include="SSH.NET" Version="2016.0.0-beta2" />

SubsystemSession

Base class for SSH subsystem implementations
protected Encoding Encoding { get; }

Gets the character encoding to use.

public bool IsOpen { get; }

Gets a value indicating whether this session is open.

protected TimeSpan OperationTimeout { get; }

Specifies a timeout to wait for operation to complete

Occurs when the server has disconnected from the session.

Occurs when an error occurred.

protected SubsystemSession(ISession session, string subsystemName, TimeSpan operationTimeout, Encoding encoding)

Initializes a new instance of the SubsystemSession class.

public void Connect()

Connects the subsystem using a new SSH channel session.

public void Disconnect()

Disconnects the subsystem channel.

public void Dispose()

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

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources

protected abstract void OnChannelOpen()

Called when channel is open.

protected abstract void OnDataReceived(byte[] data)

Called when data is received.

protected void RaiseError(Exception error)

Raises the error.

public void SendData(byte[] data)

Sends data to the subsystem.

public void WaitOnHandle(WaitHandle waitHandle, TimeSpan operationTimeout)

Waits a specified time for a given WaitHandle to get signaled.