0

I am working on a tcp server/client application using sockets in Java.

I am checking the input from the client to the server.
Each time that the client writes something the server has to print it on screen.
That part is done.

But it is also required that if the client does not write something in 120 seconds the server must terminate the connection with the client. I tried to resolve this by checking if readline().isEmpty() is null but I've read that the bufferedReader "blocks" if information is not being received.

So how should I resolve this problem?

Neo
  • 3,534
  • 2
  • 20
  • 32

0 Answers0