-1

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??

  • 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 Answers1

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