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

ShutdownSocket() private method

Shuts down the socket.
private ShutdownSocket ( SocketShutdown how ) : void
how SocketShutdown One of the values that specifies the operation that will no longer be allowed.
return void
        private void ShutdownSocket(SocketShutdown how)
        {
            if (_socket == null)
                return;

            lock (_socketShutdownAndCloseLock)
            {
                var socket = _socket;
                if (!socket.IsConnected())
                    return;

                try
                {
                    socket.Shutdown(how);
                }
                catch (SocketException ex)
                {
                    // TODO: log as warning
                    DiagnosticAbstraction.Log("Failure shutting down socket: " + ex);
                }
            }
        }