Gwupe.Communication.P2P.RUDP.Tunnel.Transport.TCPTransport.ConnectionOnConnectionClose C# (CSharp) Method

ConnectionOnConnectionClose() private method

private ConnectionOnConnectionClose ( object sender, EventArgs eventArgs ) : void
sender object
eventArgs System.EventArgs
return void
        private void ConnectionOnConnectionClose(object sender, EventArgs eventArgs)
        {
            ITcpTransportLayer connection = (ITcpTransportLayer)sender;
            if (!connection.Disconnected)
            {
                // Send the disconnect packet sequence (-> dis <- ack <- dis_rs)
                _tcpConnectionHelper.DisconnectConnection(connection.ConnectionId, connection.LastSeqSent);
            } else
            {
                SendData(new StandardDisconnectRsPacket(connection.RemoteConnectionId));
            }
            // remove the connection from our list of open connections
            _tcpConnections.Remove(connection.ConnectionId);
        }