multithreading - Accepting Multiple Clients in Java TCP and make each client wait for 5 minutes -
i trying make tcp server in java accepts 10 clients, each client should treated on thread no clients waiting. each thread receive client , make him wait 5 minutes. here's far code; public class threadserver { static class serverthread implements runnable { socket client = null; public serverthread(socket c) { this.client = c; } public void run() { try { system.out.println("connected client : "+client.getinetaddress().gethostname()); client.close(); } catch (exception e) { system.err.println(e.getmessage()); } } } public static void main(string args[]) { try { serversocket server = new serversocket(8787); while (true) { socket p = server.accept(); new thread(new serverthread(p)).start(); } } catch (exception ex) { system.err.println("error : " + ex.getmessage()); } } } this can solved scheduledexecutorservice this: public class respo...