/// <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); }
/// <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); }