If you're exiting your internal while
loop, it means you reached the end of your input stream (that's when readLine()
returns null
according to the docs).
You should be looking into the client, and not the server. What's establishing the client socket? Are you sure it's not establishing a separate connection for each line it sends?