-
Notifications
You must be signed in to change notification settings - Fork 168
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
net/tcp: Add poll_accept, poll_shared_accept and poll_shutdown #533
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.
Some small nits, otherwise I am okay to merge
match ready!(self.stream.poll_shutdown(cx, how)) { | ||
Ok(()) => Poll::Ready(Ok(())), | ||
Err(err) => Poll::Ready(Err(err.into())), | ||
} |
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.
match ready!(self.stream.poll_shutdown(cx, how)) { | |
Ok(()) => Poll::Ready(Ok(())), | |
Err(err) => Poll::Ready(Err(err.into())), | |
} | |
ready!(self.stream.poll_shutdown(cx, how)).map_err(Into::into) |
Ok(a.bind_to_executor()) | ||
} |
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 we should use poll_fn
here like elsewhere for the sake of consistency
616409a
to
d480c63
Compare
Is this PR dead? I'm in need of a non-blocking way to accept connections on a |
@glommer this seems fine to merge (I don't need it but just working through the backlog). There's an outstanding nit where the poll_shutdown isn't as absolutely concise as it could be (neither is |
What does this PR do?
Adds
TcpListener::poll_accept
,TcpListener::poll_shared_accept
andTcpStream::poll_shutdown
and internally adds
poll_collect_rw
.Motivation
The main methods I need right now for #531.