C# Class Renci.SshNet.Channels.ChannelDirectTcpip

Implements "direct-tcpip" SSH channel.
Inheritance: ClientChannel, IChannelDirectTcpip
ファイルを表示 Open project: sshnet/SSH.NET Class Usage Examples

Public Methods

Method Description
Bind ( ) : void

Binds channel to remote host.

ChannelDirectTcpip ( ISession session, uint localChannelNumber, uint localWindowSize, uint localPacketSize ) : System

Initializes a new ChannelDirectTcpip instance.

Open ( string remoteHost, uint port, IForwardedPort forwardedPort, Socket socket ) : void

Protected Methods

Method Description
Close ( ) : void

Closes the channel, waiting for the SSH_MSG_CHANNEL_CLOSE message to be received from the server.

Dispose ( bool disposing ) : void
OnData ( byte data ) : void

Called when channel data is received.

OnDisconnected ( ) : void

Called when the server wants to terminate the connection immmediately.

The sender MUST NOT send or receive any data after this message, and the recipient MUST NOT accept any data after receiving this message.

OnEof ( ) : void

Called when channel has no more data to receive.

OnErrorOccured ( Exception exp ) : void

Called whenever an unhandled Exception occurs in Session causing the message loop to be interrupted, or when an exception occurred processing a channel message.

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

Called when channel is opened by the server.

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

Private Methods

Method Description
CloseSocket ( ) : void

Closes the socket, hereby interrupting the blocking receive in Bind().

ForwardedPort_Closing ( object sender, EventArgs eventArgs ) : void

Occurs as the forwarded port is being stopped.

ShutdownSocket ( SocketShutdown how ) : void

Shuts down the socket.

Method Details

Bind() public method

Binds channel to remote host.
public Bind ( ) : void
return void

ChannelDirectTcpip() public method

Initializes a new ChannelDirectTcpip instance.
public ChannelDirectTcpip ( 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

Closes the channel, waiting for the SSH_MSG_CHANNEL_CLOSE message to be received from the server.
protected Close ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

OnData() protected method

Called when channel data is received.
protected OnData ( byte data ) : void
data byte The data.
return void

OnDisconnected() protected method

Called when the server wants to terminate the connection immmediately.
The sender MUST NOT send or receive any data after this message, and the recipient MUST NOT accept any data after receiving this message.
protected OnDisconnected ( ) : void
return void

OnEof() protected method

Called when channel has no more data to receive.
protected OnEof ( ) : void
return void

OnErrorOccured() protected method

Called whenever an unhandled Exception occurs in Session causing the message loop to be interrupted, or when an exception occurred processing a channel message.
protected OnErrorOccured ( Exception exp ) : void
exp System.Exception
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

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

Open() public method

public Open ( string remoteHost, uint port, IForwardedPort forwardedPort, Socket socket ) : void
remoteHost string
port uint
forwardedPort IForwardedPort
socket Socket
return void