public void Dispose() { if (Id == 0) { OnPreClientDisposed?.Invoke(this); } else { OnClientDisposed?.Invoke(Id); } TcpClient.Dispose(); NetworkStream.Close(); _packetSerializer = null; }
private void SocketClientsManager_OnClientDisposed(ulong Id) { OnClientDisposed?.Invoke(Id); RemoveClient(Id); }