Esempio n. 1
0
 /// <summary>
 /// Send message to all connected clients 
 /// </summary>
 /// <param name="message"></param>
 public void SendToAll(ChatMessage message)
 {
     lock (_connectedClients)
     {
         foreach (var client in _connectedClients)
         {
             client.Send(message);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Send message to all connected clients but me
        /// </summary>
        /// <param name="me"></param>
        /// <param name="message"></param>
        public void SendToAllButMe(ClientChatConnection me, ChatMessage message)
        {
            lock (_connectedClients)
            {
                foreach (var client in _connectedClients)
                {
                    if (client == me)
                        continue;

                    client.Send(message);
                }
            }
        }
Esempio n. 3
0
 public void Send(ChatMessage message)
 {
     if (message == null) throw new ArgumentNullException("message");
     Context.Write(message);
 }