protected void SendConnectionClosed(TCPServer TCPServer, DateTime ServerTimestamp, IPSocket RemoteSocket, String ConnectionId, ConnectionClosedBy ClosedBy) { OnConnectionClosed?.Invoke(TCPServer, ServerTimestamp, RemoteSocket, ConnectionId, ClosedBy); }
protected internal void SendConnectionClosed(DateTime ServerTimestamp, IPSocket RemoteSocket, String ConnectionId, ConnectionClosedBy ClosedBy) { OnConnectionClosed?.Invoke(this, ServerTimestamp, RemoteSocket, ConnectionId, ClosedBy); }
/// <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; }
/// <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; }