-
Notifications
You must be signed in to change notification settings - Fork 732
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
Readable readiness notified only once when counterpart sends two messages in a row (on Windows) #365
Comments
Sounds like you're getting hit by Nagle's algorithm. What happens when you send 1000 bytes from the client? (My hunch is that the client tcp send is buffering the data until it achives a maximum, or a period of time passes) |
It seems the Nagle's algorithm is not guilty of this one. |
Great. Thanks for checking. :) |
I have setup a repo with a unit test that can reproduce the problem, a travis build that works fine and an appveyor build that is stuck, waiting for a readable notification so it can get its 11 bytes . I guess the logs are showing what happens. |
Thanks for the report. I'll take a look |
Breaking news !!!I committed some doc comments in scaproust a couple of hours ago, and for some yet unknown reason, the windows build has passed. From the cargo output: |
The failed build happened 5 days ago, the merge commit for #356 occurred 4 days ago, so I guess the merge fixed many windows bugs, including this one. Thanks a lot !!! |
Great! I am closing this issue then. Feel free to open new ones for any further bugs discovered. Thanks. |
Hello, Any chance this one could make it into v0.6 ? Regards, |
Hello,
I'm currently trying to write a rust version of nanomsg. While the behavior of mio on Windows required only a small modification, I'm left with one problem in the following TCP client/server scenario.
Client socket (no problems here):
Server socket:
readable
, a stream is accepted.events:all
,poll:edge
.events:all
,poll:edge
.readable
stream::try_recv
tells to try again. I understand this is how Windows IOCP is used by mio, so it's OK.readable
stream::try_recv
reads 8 bytes of prefixstream::try_recv
reads 3 bytes of payloadevents:all
,poll:edge
.writable
. *This is where the difference with nix is a problem.My uneducated guess is that the two messages end up in one single buffer (OS TCP layer or mio Windows layer), raising one notification. That buffer is then discarded, since it has been presented to the user with the opportunity to read of all it.
In case this description is not clear enough, I'm currently writing a piece of code small enough to illustrate the scenario, I'll let you know when it is complete.
Regards,
Benoît
The text was updated successfully, but these errors were encountered: