-
Notifications
You must be signed in to change notification settings - Fork 813
Implement level triggering for windows #313
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this ended up being exported? Shouldn't this be an internal implementation detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poll is a public API that provides polling on only sockets (no timer / notifications). It returns IoEvent. I'm confused how Mio compiled before without having this exported.
However, I will track this as part of the api discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustc's privacy tracking is not so thorough - if something is declared with pub rustc considers it public and allows it in exported signatures, it need not be actually exported at the crate level
28ac228 to
5571548
Compare
|
@alexcrichton I have made the changes you suggest. Look good? TCP support should be done, but I still have some more outstanding items (tracked in the PR description). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may want to be deferred until the actual mem::forget below. If the me.iocp.defer branch is taken the readiness should still be applicable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait scratch that, it looks like defer will end up calling push_event which ends up doing the right thing for level triggering, so this should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Ok, this is not a candidate for merging (I will squash before merging) cc/ @alexcrichton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also do this match via or_insert(event) and then or-in the kind, it at least avoids the Entry import (but works either way)
|
I think there may also want to be some writable level handling for UdpSocket, but otherwise lgtm r+ |
The windows selector uses a linked list of currently active level-triggered events. When an event arrives and the socket is registered with level-triggered, the event is tracked in this linked list. Every call to select events will include all elements in this list. When an operation is performed on the socket such that the socket is no longer ready, the event is removed from the linked list. Closes #241
The windows selector uses a linked list of currently active level-triggered events. When an event arrives and the socket is registered with level-triggered, the event is tracked in this linked list. Every call to select events will include all elements in this list. When an operation is performed on the socket such that the socket is no longer ready, the event is removed from the linked list.
Closes #241
Remaining
unset_readinessintoschedule_foofunctions.Registration::deregister&deregister2LinkedList