Renci.SshNet.ForwardedPortLocal.CloseClientSocket C# (CSharp) Method

CloseClientSocket() private static method

private static CloseClientSocket ( Socket clientSocket ) : void
clientSocket Socket
return void
        private static void CloseClientSocket(Socket clientSocket)
        {
            if (clientSocket.Connected)
            {
                try
                {
                    clientSocket.Shutdown(SocketShutdown.Send);
                }
                catch (Exception)
                {
                    // ignore exception when client socket was already closed
                }
            }

            clientSocket.Dispose();
        }