Renci.SshNet.Channels.Channel.OnClose C# (CSharp) Method

OnClose() protected method

Called when channel is closed by the server.
protected OnClose ( ) : void
return void
        protected virtual void OnClose()
        {
            _closeMessageReceived = true;

            // signal that SSH_MSG_CHANNEL_CLOSE message was received from server
            var channelClosedWaitHandle = _channelClosedWaitHandle;
            if (channelClosedWaitHandle != null)
                channelClosedWaitHandle.Set();

            // close the channel
            Close();

            // raise event signaling that the server has closed the channel
            var closed = Closed;
            if (closed != null)
                closed(this, new ChannelEventArgs(LocalChannelNumber));
        }