Example #1
0
 protected void SendConnectionClosed(TCPServer TCPServer,
                                     DateTime ServerTimestamp,
                                     IPSocket RemoteSocket,
                                     String ConnectionId,
                                     ConnectionClosedBy ClosedBy)
 {
     OnConnectionClosed?.Invoke(TCPServer, ServerTimestamp, RemoteSocket, ConnectionId, ClosedBy);
 }
Example #2
0
 protected internal void SendConnectionClosed(DateTime ServerTimestamp,
                                              IPSocket RemoteSocket,
                                              String ConnectionId,
                                              ConnectionClosedBy ClosedBy)
 {
     OnConnectionClosed?.Invoke(this,
                                ServerTimestamp,
                                RemoteSocket,
                                ConnectionId,
                                ClosedBy);
 }
Example #3
0
        /// <summary>
        /// Close this TCP connection.
        /// </summary>
        public void Close(ConnectionClosedBy ClosedBy = ConnectionClosedBy.Server)
        {
            if (TCPClient != null)
            {
                TCPClient.Close();
            }

            if (!_IsClosed)
            {
                _TCPServer.SendConnectionClosed(DateTime.Now, RemoteSocket, ConnectionId, ClosedBy);
            }

            _IsClosed = true;
        }
Example #4
0
        /// <summary>
        /// Close this TCP connection.
        /// </summary>
        public void Close(ConnectionClosedBy ClosedBy = ConnectionClosedBy.Server)
        {
            if (TCPClient != null)
                TCPClient.Close();

            if (!_IsClosed)
                _TCPServer.SendConnectionClosed(DateTime.Now, RemoteSocket, ConnectionId, ClosedBy);

            _IsClosed = true;
        }