C# Class Renci.SshNet.SubsystemSession

Base class for SSH subsystem implementations
Inheritance: ISubsystemSession
Datei anzeigen Open project: sshnet/SSH.NET

Private Properties

Property Type Description
Channel_Closed void
Channel_DataReceived void
Channel_Exception void
EnsureNotDisposed void
EnsureSessionIsOpen void
Session_Disconnected void
Session_ErrorOccured void
SignalDisconnected void
SignalErrorOccurred void
UnsubscribeFromSessionEvents void

Public Methods

Method Description
Connect ( ) : void

Connects the subsystem using a new SSH channel session.

Disconnect ( ) : void

Disconnects the subsystem channel.

Dispose ( ) : void

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

SendData ( byte data ) : void

Sends data to the subsystem.

WaitOnHandle ( WaitHandle waitHandle, TimeSpan operationTimeout ) : void

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

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnChannelOpen ( ) : void

Called when channel is open.

OnDataReceived ( byte data ) : void

Called when data is received.

RaiseError ( Exception error ) : void

Raises the error.

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

Initializes a new instance of the SubsystemSession class.

Private Methods

Method Description
Channel_Closed ( object sender, ChannelEventArgs e ) : void
Channel_DataReceived ( object sender, ChannelDataEventArgs e ) : void
Channel_Exception ( object sender, ExceptionEventArgs e ) : void
EnsureNotDisposed ( ) : void
EnsureSessionIsOpen ( ) : void
Session_Disconnected ( object sender, EventArgs e ) : void
Session_ErrorOccured ( object sender, ExceptionEventArgs e ) : void
SignalDisconnected ( ) : void
SignalErrorOccurred ( Exception error ) : void
UnsubscribeFromSessionEvents ( ISession session ) : void

Unsubscribes the current SubsystemSession from session events.

Does nothing when session is null.

Method Details

Connect() public method

Connects the subsystem using a new SSH channel session.
The session is already connected. The method was called after the session was disposed.
public Connect ( ) : void
return void

Disconnect() public method

Disconnects the subsystem channel.
public Disconnect ( ) : void
return void

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

OnChannelOpen() protected abstract method

Called when channel is open.
protected abstract OnChannelOpen ( ) : void
return void

OnDataReceived() protected abstract method

Called when data is received.
protected abstract OnDataReceived ( byte data ) : void
data byte The data.
return void

RaiseError() protected method

Raises the error.
protected RaiseError ( Exception error ) : void
error System.Exception The error.
return void

SendData() public method

Sends data to the subsystem.
public SendData ( byte data ) : void
data byte The data to be sent.
return void

SubsystemSession() protected method

Initializes a new instance of the SubsystemSession class.
or or is null.
protected SubsystemSession ( ISession session, string subsystemName, TimeSpan operationTimeout, Encoding encoding ) : System
session ISession The session.
subsystemName string Name of the subsystem.
operationTimeout TimeSpan The operation timeout.
encoding Encoding The character encoding to use.
return System

WaitOnHandle() public method

Waits a specified time for a given WaitHandle to get signaled.
The connection was closed by the server. The channel was closed. The handle did not get signaled within the specified .
public WaitOnHandle ( WaitHandle waitHandle, TimeSpan operationTimeout ) : void
waitHandle WaitHandle The handle to wait for.
operationTimeout TimeSpan The time to wait for to get signaled.
return void