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

Channel

abstract class Channel : IDisposable
Represents base class for SSH channel implementations.
public abstract ChannelTypes ChannelType { get; }

Gets the type of the channel.

protected ConnectionInfo ConnectionInfo { get; }

Gets the connection info.

protected bool IsConnected { get; }

Gets a value indicating whether the session is connected.

public bool IsOpen { get; }

Gets a value indicating whether this channel is open.

public uint LocalChannelNumber { get; }

Gets the local channel number.

public uint LocalWindowSize { get; }

Gets the size of the local window.

public uint PacketSize { get; }

Gets the size of the packet.

public uint RemoteChannelNumber { get; }

Gets the remote channel number assigned by the server.

public uint ServerWindowSize { get; protected set; }

Gets or sets the size of the server window.

protected SemaphoreLight SessionSemaphore { get; }

Gets the session semaphore to control number of session channels

Occurs when ChannelCloseMessage message received

Occurs when ChannelDataMessage message received

Occurs when ChannelEofMessage message received

Occurs when ChannelExtendedDataMessage message received

Occurs when ChannelOpenFailureMessage message received

Occurs when ChannelFailureMessage message received

Occurs when ChannelRequestMessage message received

Occurs when ChannelSuccessMessage message received

public virtual void Close()

Closes the channel.

protected virtual void Close(bool wait)

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 virtual void OnClose()

Called when channel is closed by the server.

protected virtual void OnData(byte[] data)

Called when channel data is received.

protected virtual void OnEof()

Called when channel has no more data to receive.

protected virtual void OnExtendedData(byte[] data, uint dataTypeCode)

Called when channel extended data is received.

protected virtual void OnFailure()

Called when channel request failed.

protected virtual void OnOpen(ChannelOpenInfo info)

Called when channel need to be open on the client.

protected virtual void OnOpenConfirmation(uint remoteChannelNumber, uint initialWindowSize, uint maximumPacketSize)

Called when channel is opened by the server.

protected virtual void OnOpenFailure(uint reasonCode, string description, string language)

Called when channel failed to open.

protected virtual void OnRequest(RequestInfo info)

Called when channel request received.

protected virtual void OnSuccess()

Called when channel request was successful

protected virtual void OnWindowAdjust(uint bytesToAdd)

Called when channel window need to be adjust.

protected void SendMessage(Message message)

Sends SSH message to the server.

protected void SendMessage(ChannelOpenMessage message)

Send message to open a channel.

protected void SendMessage(ChannelCloseMessage message)

Sends close channel message to the server

protected void SendMessage(ChannelDataMessage message)

Sends channel data message to the servers.

protected void SendMessage(ChannelExtendedDataMessage message)

Sends channel extended data message to the servers.

protected void WaitHandle(WaitHandle waitHandle)

Waits for the handle to be signaled or for an error to occurs.