Stop() public method

Stops port forwarding.
public Stop ( ) : void
return void
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);
        }
Exemplo n.º 2
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();

            port.Session = null;

            this._forwardedPorts.Remove(port);
        }