Renci.SshNet.Channels.ChannelDirectTcpip.CloseSocket C# (CSharp) Method

CloseSocket() private method

Closes the socket, hereby interrupting the blocking receive in Bind().
private CloseSocket ( ) : void
return void
        private void CloseSocket()
        {
            if (_socket == null)
                return;

            lock (_socketLock)
            {
                if (_socket == null)
                    return;

                // closing a socket actually disposes the socket, so we can safely dereference
                // the field to avoid entering the lock again later
                _socket.Dispose();
                _socket = null;
            }
        }