C# Class Renci.SshNet.ForwardedPortRemote

Provides functionality for remote port forwarding
Inheritance: ForwardedPort, IDisposable
显示文件 Open project: sshnet/SSH.NET Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

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

ForwardedPortRemote ( IPAddress boundHostAddress, uint boundPort, IPAddress hostAddress, uint port ) : System

Initializes a new instance of the ForwardedPortRemote class.

ForwardedPortRemote ( string boundHost, uint boundPort, string host, uint port ) : System

Initializes a new instance of the ForwardedPortRemote class.

ForwardedPortRemote ( uint boundPort, string host, uint port ) : System

Initializes a new instance of the ForwardedPortRemote class.

Protected Methods

Method Description
CheckDisposed ( ) : void

Ensures the current instance is not disposed.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

StartPort ( ) : void

Starts remote port forwarding.

StopPort ( System.TimeSpan timeout ) : void

Stops remote port forwarding.

Private Methods

Method Description
Channel_Exception ( object sender, ExceptionEventArgs exceptionEventArgs ) : void
InitializePendingChannelCountdown ( ) : void

Initializes the CountdownEvent.

When the port is started for the first time, a CountdownEvent is created with an initial count of 1.

On subsequent (re)starts, we'll dispose the current CountdownEvent and create a new one with initial count of 1.

Session_ChannelOpening ( object sender, MessageEventArgs e ) : void
Session_RequestFailure ( object sender, EventArgs e ) : void
Session_RequestSuccess ( object sender, MessageEventArgs e ) : void

Method Details

CheckDisposed() protected method

Ensures the current instance is not disposed.
The current instance is disposed.
protected CheckDisposed ( ) : 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

ForwardedPortRemote() public method

Initializes a new instance of the ForwardedPortRemote class.
is null. is null. is greater than . is greater than .
public ForwardedPortRemote ( IPAddress boundHostAddress, uint boundPort, IPAddress hostAddress, uint port ) : System
boundHostAddress System.Net.IPAddress The bound host address.
boundPort uint The bound port.
hostAddress System.Net.IPAddress The host address.
port uint The port.
return System

ForwardedPortRemote() public method

Initializes a new instance of the ForwardedPortRemote class.
public ForwardedPortRemote ( string boundHost, uint boundPort, string host, uint port ) : System
boundHost string The bound host.
boundPort uint The bound port.
host string The host.
port uint The port.
return System

ForwardedPortRemote() public method

Initializes a new instance of the ForwardedPortRemote class.
public ForwardedPortRemote ( uint boundPort, string host, uint port ) : System
boundPort uint The bound port.
host string The host.
port uint The port.
return System

StartPort() protected method

Starts remote port forwarding.
protected StartPort ( ) : void
return void

StopPort() protected method

Stops remote port forwarding.
protected StopPort ( System.TimeSpan timeout ) : void
timeout System.TimeSpan The maximum amount of time to wait for the port to stop.
return void