public void BroadCastExceptSender(IComMessage msg, ClientInfo client)
 {
     foreach (Client item in m_workerSocketList.ToArray())
     {
         if(item.ClientInfo.ID != client.ID)
             item.SendMessage(msg);
     }
 }
 public void Remove(ClientInfo item, ListBox list)
 {
     if (list.InvokeRequired)
     {
         list.BeginInvoke(new MethodInvoker(delegate
         {
             Remove(item, list);
         }));
     }
     else
     {
         list.Items.Remove(item);
     }
 }
        public Client(Socket socket, int id)
        {
            dataBuffer = new byte[1024];
            Socket = socket;
            packetHandler = new PacketHandler();
            packetHandler.CompletePacketReceived += new PacketHandler.CompletePacketReceivedEventHandler(packetHandler_CompletePacketReceived);

            clientInfo = new ClientInfo();
            clientInfo.ID = id;

            // Let the worker Socket do the further processing for the
            // just connected client
            WaitForData();
        }
 public void SendMsgToClient(IComMessage msg, ClientInfo Client)
 {
     foreach (Client item in m_workerSocketList)
     {
         if (item.ClientInfo.ID == Client.ID)
             item.SendMessage(msg);
     }
 }