I made an httpServer in java in order to send files to a client. The problem is that after I send the file I've been asked for me server keeps getting null commands in buffereader and throws broken Pipe exception. Is there a way to avoid getting null commands??
Asked
Active
Viewed 359 times
-1
-
Possible duplicate of [What causes the Broken Pipe Error?](http://stackoverflow.com/questions/4584904/what-causes-the-broken-pipe-error) – zloster Apr 22 '17 at 16:42
1 Answers
2
There is no such thing as a 'null command in BufferedReader
', but there is such a thing as BufferedReader.readLine()
returning null, which means the peer has closed the connection, and you should do likewise.

user207421
- 305,947
- 44
- 307
- 483
-
You are rigth. I didn't write it correctly. My problem is that with BufferedReader.readLine() returns null and my programm throws exception. Is there a way to prevent that from happening? – Dimitris Manonegra Apr 23 '17 at 16:48
-