summaryrefslogtreecommitdiffstats
path: root/tokio
diff options
context:
space:
mode:
authorkalcutter <kal.conley@dectris.com>2020-09-23 16:21:18 +0200
committerGitHub <noreply@github.com>2020-09-23 16:21:18 +0200
commit3114d9e826e5aa1948d394a7d6d488f61ab1da97 (patch)
tree60d21e1aee27ad03ca9b360a8473b8e06f810315 /tokio
parent5467f0a573c915d9c1a8c032803109b495784b29 (diff)
net: change `UnixListener::poll_accept` to public (#2845)
Diffstat (limited to 'tokio')
-rw-r--r--tokio/src/net/tcp/listener.rs6
-rw-r--r--tokio/src/net/unix/listener.rs6
2 files changed, 8 insertions, 4 deletions
diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs
index 44945e38..0d7bbdbb 100644
--- a/tokio/src/net/tcp/listener.rs
+++ b/tokio/src/net/tcp/listener.rs
@@ -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<'_>,
diff --git a/tokio/src/net/unix/listener.rs b/tokio/src/net/unix/listener.rs
index 119dc6fb..fc3c8710 100644
--- a/tokio/src/net/unix/listener.rs
+++ b/tokio/src/net/unix/listener.rs
@@ -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)>> {