diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-01-14 14:02:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-14 14:02:24 +0900 |
| commit | 725f88b09c4fdf718c47439a3fe6a5970d16aaac (patch) | |
| tree | 70cad0e4c8526c23dd5ca2b02088103b7ead634b /src/libstd/sys | |
| parent | d7e599203c3d3abbc3be486792a76cb89d3fa067 (diff) | |
| parent | c32090c130273787b8f9fc8290357a6a9d3222b7 (diff) | |
| download | rust-725f88b09c4fdf718c47439a3fe6a5970d16aaac.tar.gz rust-725f88b09c4fdf718c47439a3fe6a5970d16aaac.zip | |
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`.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/ext/net.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index e0e6e02a443..4c3cb67c9ee 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -902,6 +902,12 @@ impl UnixListener { /// Moves the socket into or out of nonblocking mode. /// + /// This will result in the `accept` operation becoming nonblocking, + /// i.e., immediately returning from their calls. If the IO operation is + /// successful, `Ok` is returned and no further action is required. If the + /// IO operation could not be completed and needs to be retried, an error + /// with kind [`io::ErrorKind::WouldBlock`] is returned. + /// /// # Examples /// /// ```no_run @@ -913,6 +919,8 @@ impl UnixListener { /// Ok(()) /// } /// ``` + /// + /// [`io::ErrorKind::WouldBlock`]: ../../../io/enum.ErrorKind.html#variant.WouldBlock #[stable(feature = "unix_socket", since = "1.10.0")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { self.0.set_nonblocking(nonblocking) |
