예제 #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);
         }
     }
 }
예제 #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);
                }
            }
        }
예제 #3
0
 public void Send(ChatMessage message)
 {
     if (message == null) throw new ArgumentNullException("message");
     Context.Write(message);
 }