Skip to content

Commit 725f88b

Browse files
authored
Rollup merge of #68150 - tillarnold:master, r=cramertj
Document behavior of set_nonblocking on UnixListener The description on `set_nonblocking` in `UnixListener` was rather brief so I adapted it to be more like the documentation of `set_nonblocking` in `TcpListener`.
2 parents d7e5992 + c32090c commit 725f88b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/sys/unix/ext/net.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,12 @@ impl UnixListener {
902902

903903
/// Moves the socket into or out of nonblocking mode.
904904
///
905+
/// This will result in the `accept` operation becoming nonblocking,
906+
/// i.e., immediately returning from their calls. If the IO operation is
907+
/// successful, `Ok` is returned and no further action is required. If the
908+
/// IO operation could not be completed and needs to be retried, an error
909+
/// with kind [`io::ErrorKind::WouldBlock`] is returned.
910+
///
905911
/// # Examples
906912
///
907913
/// ```no_run
@@ -913,6 +919,8 @@ impl UnixListener {
913919
/// Ok(())
914920
/// }
915921
/// ```
922+
///
923+
/// [`io::ErrorKind::WouldBlock`]: ../../../io/enum.ErrorKind.html#variant.WouldBlock
916924
#[stable(feature = "unix_socket", since = "1.10.0")]
917925
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
918926
self.0.set_nonblocking(nonblocking)

0 commit comments

Comments
 (0)