Renci.SshNet.ForwardedPortLocal.StopPort C# (CSharp) Method

StopPort() protected method

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.
return void
        protected override void StopPort(TimeSpan timeout)
        {
            if (!ForwardedPortStatus.ToStopping(ref _status))
                return;

            // signal existing channels that the port is closing
            base.StopPort(timeout);
            // prevent new requests from getting processed
            StopListener();
            // wait for open channels to close
            InternalStop(timeout);
            // mark port stopped
            _status = ForwardedPortStatus.Stopped;
        }