ServerSocket.accept() returns a new Socket with I/O streams for the connected client. Since you want to handle multiple simultaneous clients (do you?), you can't handle I/O with the client right there in that
thread.
Instead, you create a new Thread (or grab one from a ThreadPool) and give it the Socket to handle client I/O.
Then you continue in your accept loop, calling ServerSocket.accept() for the next client connection.
The easiest way is to have one Thread for the accept loop and one Thread per client connection. The class that will handle client I/O could look something like this:
Your server's accept loop would be like this:
Obviously, you'll need to fill those out a bit.
