Fork me on GitHub
#aleph
<
2019-11-18
>
flowthing14:11:17

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.

flowthing14:11:45

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

flowthing14:11:54

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