/// <summary> /// Do the work. /// </summary> public void DoWork() { try { server.listener.Start(); while (!ShouldStop) { // Continue until graceful stop is requested. // Accept new clients. while (server.listener.Pending()) { var tcpClient = server.listener.AcceptTcpClient(); var client = new Client(server, tcpClient); client.Start(); server.clients.AddLast(client); } // Ping MITMClients to check for dead threads (response time > 5000). } // Graceful stop. CleanUp(); server.listener.Stop(); } catch (Exception e) { Console.WriteLine(e); return; } }
public ClientWorker (Client client) { this.client = client; }