Exemplo n.º 1
0
 public bool RemoveClient(ClientWorker client)
 {
     lock (this)
     {
         return(_clients.Remove(client));
     }
 }
Exemplo n.º 2
0
 public void RemoveDuplicates(ClientWorker client)
 {
     if (RemoveClient(client))
     {
         LogConsole("removed mysterious duplicate.", client.LocalIPEndPoint);
     }
 }
Exemplo n.º 3
0
        public void CreateNewClient(Socket socket)
        {
            ClientWorker newClient = new ClientWorker(socket);

            newClient.PacketReceivedEvent     += new PacketReceivedEventHandler(PacketReceived);
            newClient.ClientDisconnectedEvent += new ClientDisconnectedEventHandler(ClientDisconnected);
            RemoveDuplicates(newClient);
            _clients.Add(newClient);
            LogConsole("connected.", newClient.LocalIPEndPoint);
        }