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

PollItem: Support checking associated socket #292

Merged
merged 1 commit into from
Dec 28, 2019

Conversation

fwalch
Copy link
Contributor

@fwalch fwalch commented Dec 15, 2019

Adds is_socket and is_fd to PollItem to allow checking which socket a
PollItem has been created from.

Enables some use cases related to #68.

src/lib.rs Outdated Show resolved Hide resolved
@fwalch fwalch force-pushed the pollitem-identification branch from bcd9d0c to 075825d Compare December 16, 2019 16:37
@fwalch
Copy link
Contributor Author

fwalch commented Dec 17, 2019

Thanks for the comment, fixed the issue and added an assertion to the tests.

I'm not completely happy with the function names, as they are very similar to the revents checks (e.g. is_readable). I kept them because they were the shortest ones I could come up with. If you have any suggestions, I'd be happy to change them.

@rotty
Copy link
Collaborator

rotty commented Dec 17, 2019

Thanks for updating! I agree naming these is_ is suboptimal, a it's commonly used for predicates, which take no arguments. What about has_fd and has_socket?

Adds has_socket and has_fd to PollItem to allow checking which socket a
PollItem has been created from.

Enables some use cases related to erickt#68.
@fwalch fwalch force-pushed the pollitem-identification branch from 075825d to e9f795f Compare December 21, 2019 08:38
@fwalch
Copy link
Contributor Author

fwalch commented Dec 21, 2019

What about has_fd and has_socket?

Renamed the functions.

@rotty rotty merged commit cc7ddac into erickt:master Dec 28, 2019
@rotty
Copy link
Collaborator

rotty commented Dec 28, 2019

Thanks!

@fwalch fwalch deleted the pollitem-identification branch December 29, 2019 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants