aleph

flowthing 2019-11-18T14:15:17.032Z

I have a request handler that instantiates a PipedReader and a PipedWriter. I write messages into the pipe, they're handled in another thread, which puts the result back into the pipe. Everything works fine, except when the processing takes enough time, the pipe just up and dies with Stream closed. Everything works OK if I instantiate the reader and the writer outside the request handler, but that's not going to work because I need to be able to close the reader and the writer. Does anyone have any ideas what might cause something like this? It's driving me crazy.

flowthing 2019-11-18T14:32:45.032100Z

Actually, looks like I'm getting Stream closed even when I instantiate them outside the handler... sigh.

flowthing 2019-11-18T14:57:54.032300Z

Looks like using wrapping the pipe with BufferedWriter and BufferedReader solves the issue.

flowthing 2019-11-18T15:04:50.032500Z

Or not.