public IServerService CreateClient(EndPoint remoteEndPoint) { var client = new ClientChatConnection(this); client.Disconnected += OnClientDisconnect; lock (_connectedClients) _connectedClients.Add(client); return(client); }
public void SendToAllButMe(ClientChatConnection me, ChatMessage message) { lock (_connectedClients) { foreach (var client in _connectedClients) { if (client == me) { continue; } client.Send(message); } } }