Renci.SshNet.SubsystemSession.Disconnect C# (CSharp) Method

Disconnect() public method

Disconnects the subsystem channel.
public Disconnect ( ) : void
return void
        public void Disconnect()
        {
            UnsubscribeFromSessionEvents(_session);

            var channel = _channel;
            if (channel != null)
            {
                _channel = null;
                channel.DataReceived -= Channel_DataReceived;
                channel.Exception -= Channel_Exception;
                channel.Closed -= Channel_Closed;
                channel.Dispose();
            }
        }