<PackageReference Include="SSH.NET" Version="2020.0.0" />

ForwardedPort

public abstract class ForwardedPort : IForwardedPort
Base class for port forwarding functionality.
public abstract bool IsStarted { get; }

Gets a value indicating whether port forwarding is started.

Occurs when an exception is thrown.

Occurs when a port forwarding request is received.

protected ForwardedPort()

protected abstract void CheckDisposed()

Ensures the current instance is not disposed.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources

protected void RaiseExceptionEvent(Exception exception)

Raises Exception event.

protected void RaiseRequestReceived(string host, uint port)

Raises RequestReceived event.

public virtual void Start()

Starts port forwarding.

protected abstract void StartPort()

Starts port forwarding.

public virtual void Stop()

Stops port forwarding.

protected virtual void StopPort(TimeSpan timeout)

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