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

Change UnixListener::poll_accept to public #2845

Merged
merged 1 commit into from Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions tokio/src/net/tcp/listener.rs
Expand Up @@ -185,10 +185,10 @@ impl TcpListener {
poll_fn(|cx| self.poll_accept(cx)).await
}

/// Attempts to poll `SocketAddr` and `TcpStream` bound to this address.
/// Polls to accept a new incoming connection to this listener.
///
/// In case if I/O resource isn't ready yet, `Poll::Pending` is returned and
/// current task will be notified by a waker.
/// If there is no connection to accept, `Poll::Pending` is returned and
/// the current task will be notified by a waker.
pub fn poll_accept(
&mut self,
cx: &mut Context<'_>,
Expand Down
6 changes: 5 additions & 1 deletion tokio/src/net/unix/listener.rs
Expand Up @@ -104,7 +104,11 @@ impl UnixListener {
poll_fn(|cx| self.poll_accept(cx)).await
}

pub(crate) fn poll_accept(
/// Polls to accept a new incoming connection to this listener.
///
/// If there is no connection to accept, `Poll::Pending` is returned and
/// the current task will be notified by a waker.
pub fn poll_accept(
&mut self,
cx: &mut Context<'_>,
) -> Poll<io::Result<(UnixStream, SocketAddr)>> {
Expand Down