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

CloseSocket() private method

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

            lock (_socketShutdownAndCloseLock)
            {
                var socket = _socket;
                if (socket != null)
                {
                    _socket = null;
                    socket.Dispose();
                }
            }
        }