Table of Contents

Class ForwardedPortLocal

Namespace
Renci.SshNet
Assembly
Renci.SshNet.dll

Provides functionality for local port forwarding.

public class ForwardedPortLocal : ForwardedPort, IForwardedPort, IDisposable

Inheritance

Implements

Inherited Members

Constructors

ForwardedPortLocal(uint, string, uint)

Initializes a new instance of the Renci.SshNet.ForwardedPortLocal class.

public ForwardedPortLocal(uint boundPort, string host, uint port)

Parameters

boundPort uint

The bound port.

host string

The host.

port uint

The port.

Exceptions

ArgumentOutOfRangeException

boundPort is greater than System.Net.IPEndPoint.MaxPort.

ArgumentNullException

host is null.

ArgumentOutOfRangeException

port is greater than System.Net.IPEndPoint.MaxPort.

ForwardedPortLocal(string, string, uint)

Initializes a new instance of the Renci.SshNet.ForwardedPortLocal class.

public ForwardedPortLocal(string boundHost, string host, uint port)

Parameters

boundHost string

The bound host.

host string

The host.

port uint

The port.

Exceptions

ArgumentNullException

boundHost is null.

ArgumentNullException

host is null.

ArgumentOutOfRangeException

port is greater than System.Net.IPEndPoint.MaxPort.

ForwardedPortLocal(string, uint, string, uint)

Initializes a new instance of the Renci.SshNet.ForwardedPortLocal class.

public ForwardedPortLocal(string boundHost, uint boundPort, string host, uint port)

Parameters

boundHost string

The bound host.

boundPort uint

The bound port.

host string

The host.

port uint

The port.

Exceptions

ArgumentNullException

boundHost is null.

ArgumentNullException

host is null.

ArgumentOutOfRangeException

boundPort is greater than System.Net.IPEndPoint.MaxPort.

ArgumentOutOfRangeException

port is greater than System.Net.IPEndPoint.MaxPort.

Properties

BoundHost

Gets the bound host.

public string BoundHost { get; }

Property Value

string

BoundPort

Gets the bound port.

public uint BoundPort { get; }

Property Value

uint

Host

Gets the forwarded host.

public string Host { get; }

Property Value

string

IsStarted

Gets a value indicating whether port forwarding is started.

public override bool IsStarted { get; }

Property Value

bool

Port

Gets the forwarded port.

public uint Port { get; }

Property Value

uint

Methods

CheckDisposed()

Ensures the current instance is not disposed.

protected override void CheckDisposed()

Exceptions

ObjectDisposedException

The current instance is disposed.

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

~ForwardedPortLocal()

Finalizes an instance of the Renci.SshNet.ForwardedPortLocal class.

protected ~ForwardedPortLocal()

StartPort()

Starts local port forwarding.

protected override void StartPort()

StopPort(TimeSpan)

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

protected override void StopPort(TimeSpan timeout)

Parameters

timeout TimeSpan

The maximum amount of time to wait for pending requests to finish processing.