-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
MessageBuilder: header partial read #299
Comments
In addition: the client breaks the loop by IOException and calls HandleServerDisconnected in WatsonTcp/src/WatsonTcp/WatsonTcpClient.cs Line 982 in 49d796e
But at the same time, SendAsync is waiting on the server and it will not be released by CancelationToken.Cancel, because the client does not call Disconnect(), which should have sent the Shutdown packet. The TCP connection is active, and the client is in the _Connected = false state. As a result, we have a hung thread on the sending side. |
Related to #263. |
Resolving in 6.0.8, uploading in a few moments. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WatsonTcp/src/WatsonTcp/WatsonMessageBuilder.cs
Line 107 in 49d796e
There is no check for read count so header can be read partially. Then array has zero bytes at end and check for zeros generates exception "Null header data indicates peer disconnected". There should be
while (readCount < 24)
loop. I think I got partial reads on real network because logs contains "Null header data indicates peer disconnected".Also read can return 0 count for gracefully closed socket.
Line:
WatsonTcp/src/WatsonTcp/WatsonMessageBuilder.cs
Line 130 in 49d796e
Also should check for 0 count.
The text was updated successfully, but these errors were encountered: