I am writing a messaging application in java using sockets and currently the server will wait for a request and just automatically accept it:
ServerSocket s = new ServerSocket(1254);
Socket s1 = s.accept();
If there any way in which I can detect requests to the server and allow the server to only accept certain requests?
Socketto a distinctThreadto let theServerSocketaccept the next one is better too.