Replies: 1 comment
-
I'd say this. But I agree with you a 0 byte read would be preferable, particularly for a normal shutdown. I'd accept a PR if you can offer a fix. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a client that writes text to a
WebSocketline by line. Server usesnew StreamReader(serverSocket.AsStream())+ReadLinecalls to read this text.The issue is if I explicitly close the connection on the client side using
CloseOutputAsync(NormalClosure, "Done", CancellationToken.None)ReadLineon the server fails withIOException"The remote end closed the connection".What I expected, however, was
nullreturn fromReadLine(I guess consequentially, I expectedWebSocketStream.Readcall to return 0 when graceful close message received.I was wondering if this is a bug, or just a case of leaky abstraction.
Documentation for NetworkStream.Read says 0 is returned if the remote party performed a graceful shutdown.
Beta Was this translation helpful? Give feedback.
All reactions