Esempio n. 1
0
 public bool RemoveClient(ClientWorker client)
 {
     lock (this)
     {
         return(_clients.Remove(client));
     }
 }
Esempio n. 2
0
 public void RemoveDuplicates(ClientWorker client)
 {
     if (RemoveClient(client))
     {
         LogConsole("removed mysterious duplicate.", client.LocalIPEndPoint);
     }
 }
Esempio 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);
        }