Renci.SshNet.ForwardedPort.Stop C# (CSharp) Method

Stop() public method

Stops port forwarding.
public Stop ( ) : void
return void
        public virtual void Stop()
        {
            CheckDisposed();

            if (IsStarted)
            {
                StopPort(Session.ConnectionInfo.Timeout);
            }
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Stops and removes the forwarded port from the list.
        /// </summary>
        /// <param name="port">Forwarded port.</param>
        /// <exception cref="ArgumentNullException"><paramref name="port"/> is null.</exception>
        public void RemoveForwardedPort(ForwardedPort port)
        {
            if (port == null)
            {
                throw new ArgumentNullException("port");
            }

            //  Stop port forwarding before removing it
            port.Stop();

            this._forwardedPorts.Remove(port);
        }
All Usage Examples Of Renci.SshNet.ForwardedPort::Stop