private void ServerConnectionClosed(object sender, TcpClientConnectionEventArgs e) { if (_onlineUsers.TryRemove(e.TcpClient, out var user) && user != null) { OnUserSignOut(new MidgeUserEventArgs(user)); } }
private void ServerConnectionOpened(object sender, TcpClientConnectionEventArgs e) { _onlineUsers.TryAdd(e.TcpClient, null); }