C# Класс Renci.SshNet.ForwardedPortLocal

Provides functionality for local port forwarding
Наследование: ForwardedPort, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

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

ForwardedPortLocal ( string boundHost, string host, uint port ) : System

Initializes a new instance of the ForwardedPortLocal class.

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

Initializes a new instance of the ForwardedPortLocal class.

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

Initializes a new instance of the ForwardedPortLocal class.

Защищенные методы

Метод Описание
CheckDisposed ( ) : void

Ensures the current instance is not disposed.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

StartPort ( ) : void

Starts local port forwarding.

StopPort ( System.TimeSpan timeout ) : void

Stops local port forwarding, and waits for the specified timeout until all pending requests are processed.

Приватные методы

Метод Описание
AcceptCompleted ( object sender, SocketAsyncEventArgs e ) : void
Channel_Exception ( object sender, System.ExceptionEventArgs e ) : void
CloseClientSocket ( Socket clientSocket ) : 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.

InternalDispose ( bool disposing ) : void
InternalStart ( ) : void
InternalStop ( System.TimeSpan timeout ) : void
ProcessAccept ( Socket clientSocket ) : void
Session_Disconnected ( object sender, EventArgs e ) : void
Session_ErrorOccured ( object sender, System.ExceptionEventArgs e ) : void
StartAccept ( SocketAsyncEventArgs e ) : void
StopListener ( ) : void

Interrupts the listener, and waits for the listener loop to finish.

When the forwarded port is stopped, then any further action is skipped.

Описание методов

CheckDisposed() защищенный Метод

Ensures the current instance is not disposed.
The current instance is disposed.
protected CheckDisposed ( ) : void
Результат void

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

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.
Результат void

ForwardedPortLocal() публичный Метод

Initializes a new instance of the ForwardedPortLocal class.
is null. is null. is greater than .
public ForwardedPortLocal ( string boundHost, string host, uint port ) : System
boundHost string The bound host.
host string The host.
port uint The port.
Результат System

ForwardedPortLocal() публичный Метод

Initializes a new instance of the ForwardedPortLocal class.
is null. is null. is greater than . is greater than .
public ForwardedPortLocal ( 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.
Результат System

ForwardedPortLocal() публичный Метод

Initializes a new instance of the ForwardedPortLocal class.
is greater than . is null. is greater than .
public ForwardedPortLocal ( uint boundPort, string host, uint port ) : System
boundPort uint The bound port.
host string The host.
port uint The port.
Результат System

StartPort() защищенный Метод

Starts local port forwarding.
protected StartPort ( ) : void
Результат void

StopPort() защищенный Метод

Stops local port forwarding, and waits for the specified timeout until all pending requests are processed.
protected StopPort ( System.TimeSpan timeout ) : void
timeout System.TimeSpan The maximum amount of time to wait for pending requests to finish processing.
Результат void