net: change UnixListener::poll_accept to public (#2845)

This commit is contained in:
kalcutter
2020-09-23 16:21:18 +02:00
committed by GitHub
parent 5467f0a573
commit 3114d9e826
2 changed files with 8 additions and 4 deletions
+3 -3
View File
@@ -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<'_>,
+5 -1
View File
@@ -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)>> {