-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'OutputStream Builder' has confusing semantics #27
Comments
The bug here is that after the first connect, subsequent writes to the channel should be no-ops (i.e. the output stream should be closed because connect sends EOF). It looks like instead we're retaining part of the buffer. |
Hm, weird, I can't reproduce with "listOutputStream". Maybe the problem is in the handle code. |
The default stuff that comes out of the box should be safe, i.e. we should have enforced the stream invariant for you with "makeOutputStream". Should be fixed now. |
Thanks, makes sense. |
Consider the following program:
Just looking at the code, I'd expect the output in both cases to be identical. In the first case I get the expected result:
However, in the second case I get:
The result also depends on the position of the
Streams.write Nothing os
line. E.g. if I delete it, I get:And if I move it before the last
connect
, I get:All this is utterly confusing.
The text was updated successfully, but these errors were encountered: