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

Add Async::new_nonblocking and avoid needless set_nonblocking calls #159

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

taiki-e
Copy link
Collaborator

@taiki-e taiki-e commented Oct 8, 2023

connect() already sets socket to non-blocking mode.

The second comment exposes Async::new_nonblocking to resolve #132.

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

src/lib.rs Outdated

fn new_nonblocking(io: T) -> io::Result<Async<T>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this public to solve #132?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in de07b6a.

@taiki-e taiki-e changed the title Avoid needless set_nonblocking calls Add Async::new_nonblocking and avoid needless set_nonblocking calls Oct 8, 2023
@taiki-e taiki-e requested a review from notgull October 8, 2023 09:50
connect() already sets socket to non-blocking mode.
src/lib.rs Outdated
Comment on lines 763 to 764
/// On Unix systems, the handle must implement `AsRawFd`, while on Windows it must implement
/// `AsRawSocket`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This is supposed to be AsFd and AsSocket.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@taiki-e taiki-e merged commit a5da16f into master Oct 8, 2023
21 checks passed
@taiki-e taiki-e deleted the taiki-e/nonblocking branch October 8, 2023 15:00
@notgull notgull mentioned this pull request Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support creating Async without setting non-blocking mode
2 participants