Skip to content

Commit c32090c

Browse files
committed
Document behavior of set_nonblocking on UnixListener
1 parent bfd0487 commit c32090c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

+8
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)