How to detect in the server that the client has closed the socket? When the client dies accidently the server goes in an infinite loop.

Krzysztof Raciniewski

The BufferedReader.read method returns -1 if the end of stream is reached (if your socket is closed). You should check your character for -1 and end the loop.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact