C# Class Renci.SshNet.Channels.ChannelSession

Implements Session SSH channel.
Inheritance: Channel
ファイルを表示 Open project: sshnet/SSH.NET Class Usage Examples

Public Methods

Method Description
ChannelSession ( ISession session, uint localChannelNumber, uint localWindowSize, uint localPacketSize ) : System

Initializes a new ChannelSession instance.

Open ( ) : void

Opens the channel.

SendBreakRequest ( uint breakLength ) : bool

Sends the exec request.

SendEndOfWriteRequest ( ) : bool

Sends [email protected] request.

SendEnvironmentVariableRequest ( string variableName, string variableValue ) : bool

Sends the environment variable request.

SendExecRequest ( string command ) : bool

Sends the exec request.

SendExitSignalRequest ( string signalName, bool coreDumped, string errorMessage, string language ) : bool

Sends the exit signal request.

SendExitStatusRequest ( uint exitStatus ) : bool

Sends the exit status request.

SendKeepAliveRequest ( ) : bool

Sends [email protected] request.

SendLocalFlowRequest ( bool clientCanDo ) : bool

Sends the local flow request.

SendPseudoTerminalRequest ( string environmentVariable, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModeValues ) : bool

Sends the pseudo terminal request.

SendShellRequest ( ) : bool

Sends the shell request.

SendSignalRequest ( string signalName ) : bool

Sends the signal request.

SendSubsystemRequest ( string subsystem ) : bool

Sends the subsystem request.

SendWindowChangeRequest ( uint columns, uint rows, uint width, uint height ) : bool

Sends the window change request.

SendX11ForwardingRequest ( bool isSingleConnection, string protocol, byte cookie, uint screenNumber ) : bool

Sends the X11 forwarding request.

Protected Methods

Method Description
Close ( ) : void
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnFailure ( ) : void

Called when channel request failed.

OnOpenConfirmation ( uint remoteChannelNumber, uint initialWindowSize, uint maximumPacketSize ) : void

Called when channel is opened by the server.

OnOpenFailure ( uint reasonCode, string description, string language ) : void

Called when channel failed to open.

OnSuccess ( ) : void

Called when channel request was successful

SendChannelOpenMessage ( ) : void

Sends the channel open message.

Private Methods

Method Description
ReleaseSemaphore ( ) : void

Releases the session semaphore.

When the session semaphore has already been released, or was never obtained by this instance, then this method does nothing.

Method Details

ChannelSession() public method

Initializes a new ChannelSession instance.
public ChannelSession ( ISession session, uint localChannelNumber, uint localWindowSize, uint localPacketSize ) : System
session ISession The session.
localChannelNumber uint The local channel number.
localWindowSize uint Size of the window.
localPacketSize uint Size of the packet.
return System

Close() protected method

protected Close ( ) : 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

OnFailure() protected method

Called when channel request failed.
protected OnFailure ( ) : void
return void

OnOpenConfirmation() protected method

Called when channel is opened by the server.
protected OnOpenConfirmation ( uint remoteChannelNumber, uint initialWindowSize, uint maximumPacketSize ) : void
remoteChannelNumber uint The remote channel number.
initialWindowSize uint Initial size of the window.
maximumPacketSize uint Maximum size of the packet.
return void

OnOpenFailure() protected method

Called when channel failed to open.
protected OnOpenFailure ( uint reasonCode, string description, string language ) : void
reasonCode uint The reason code.
description string The description.
language string The language.
return void

OnSuccess() protected method

Called when channel request was successful
protected OnSuccess ( ) : void
return void

Open() public method

Opens the channel.
public Open ( ) : void
return void

SendBreakRequest() public method

Sends the exec request.
public SendBreakRequest ( uint breakLength ) : bool
breakLength uint Length of the break.
return bool

SendChannelOpenMessage() protected method

Sends the channel open message.
protected SendChannelOpenMessage ( ) : void
return void

SendEndOfWriteRequest() public method

Sends [email protected] request.
public SendEndOfWriteRequest ( ) : bool
return bool

SendEnvironmentVariableRequest() public method

Sends the environment variable request.
public SendEnvironmentVariableRequest ( string variableName, string variableValue ) : bool
variableName string Name of the variable.
variableValue string The variable value.
return bool

SendExecRequest() public method

Sends the exec request.
public SendExecRequest ( string command ) : bool
command string The command.
return bool

SendExitSignalRequest() public method

Sends the exit signal request.
public SendExitSignalRequest ( string signalName, bool coreDumped, string errorMessage, string language ) : bool
signalName string Name of the signal.
coreDumped bool if set to true [core dumped].
errorMessage string The error message.
language string The language.
return bool

SendExitStatusRequest() public method

Sends the exit status request.
public SendExitStatusRequest ( uint exitStatus ) : bool
exitStatus uint The exit status.
return bool

SendKeepAliveRequest() public method

Sends [email protected] request.
public SendKeepAliveRequest ( ) : bool
return bool

SendLocalFlowRequest() public method

Sends the local flow request.
public SendLocalFlowRequest ( bool clientCanDo ) : bool
clientCanDo bool if set to true [client can do].
return bool

SendPseudoTerminalRequest() public method

Sends the pseudo terminal request.
public SendPseudoTerminalRequest ( string environmentVariable, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModeValues ) : bool
environmentVariable string The environment variable.
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
terminalModeValues uint>.IDictionary The terminal mode values.
return bool

SendShellRequest() public method

Sends the shell request.
public SendShellRequest ( ) : bool
return bool

SendSignalRequest() public method

Sends the signal request.
public SendSignalRequest ( string signalName ) : bool
signalName string Name of the signal.
return bool

SendSubsystemRequest() public method

Sends the subsystem request.
public SendSubsystemRequest ( string subsystem ) : bool
subsystem string The subsystem.
return bool

SendWindowChangeRequest() public method

Sends the window change request.
public SendWindowChangeRequest ( uint columns, uint rows, uint width, uint height ) : bool
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
return bool

SendX11ForwardingRequest() public method

Sends the X11 forwarding request.
public SendX11ForwardingRequest ( bool isSingleConnection, string protocol, byte cookie, uint screenNumber ) : bool
isSingleConnection bool if set to true the it is single connection.
protocol string The protocol.
cookie byte The cookie.
screenNumber uint The screen number.
return bool