Skip to content
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

Single Evented on more than on Poll #674

Closed
dtolnay opened this issue Aug 18, 2017 · 2 comments
Closed

Single Evented on more than on Poll #674

dtolnay opened this issue Aug 18, 2017 · 2 comments

Comments

@dtolnay
Copy link

dtolnay commented Aug 18, 2017

Question from i.r-l.o:

Can a single Evented be registered on more than one Poll? What happens? The documentation doesn’t seem to clearly say anything.

@cramertj
Copy link
Contributor

This comment in the Unix implementation says that only one poll registration per Evented is supported:

/// Each Selector has a globally unique(ish) ID associated with it. This ID
/// gets tracked by `TcpStream`, `TcpListener`, etc... when they are first
/// registered with the `Selector`. If a type that is previously associated with
/// a `Selector` attempts to register itself with a different `Selector`, the
/// operation will return with an error. This matches windows behavior.

@carllerche
Copy link
Member

Yes, Evented values can only be registered with a single Poll instance ever (even if the value is deregistered). There are non-portable work arounds (like using a FD directly).

@tobz tobz closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants