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

ForwardedPort_Closing() private method

Occurs as the forwarded port is being stopped.
private ForwardedPort_Closing ( object sender, EventArgs eventArgs ) : void
sender object
eventArgs System.EventArgs
return void
        private void ForwardedPort_Closing(object sender, EventArgs eventArgs)
        {
            // signal to the client that we will not send anything anymore; this should also interrupt the
            // blocking receive in Bind if the client sends FIN/ACK in time
            ShutdownSocket(SocketShutdown.Send);

            // if the FIN/ACK is not sent in time by the remote client, then interrupt the blocking receive
            // by closing the socket
            CloseSocket();
        }