about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-09-29 12:37:52 +0200
committerGitHub <noreply@github.com>2024-09-29 12:37:52 +0200
commitee8ca3aa6ca9e8fe5414df7520dd45988e03c10a (patch)
tree1db86a192819cdabbf8268b2d0dafd2174112acf
parented5d779f4452205ec758d0530c17f250394b28a9 (diff)
parente424a8c01f454ba73e4e75b9b1d648208ba9744e (diff)
downloadrust-ee8ca3aa6ca9e8fe5414df7520dd45988e03c10a.tar.gz
rust-ee8ca3aa6ca9e8fe5414df7520dd45988e03c10a.zip
Rollup merge of #130743 - YohDeadfall:net-nonblocking-doc, r=Mark-Simulacrum
Clarifications for set_nonblocking methods

Closes #129903.

The issue mentions that `send`, `recv` and other operations are interpreted by some users as methods of `TcpSocket` which led to confusion since it hasn't them. To fix it I added "system" into the documentation as being more precise for two reasons:
* it's makes it clear that these names are system operations;
* it doesn't point to the location of these methods like `libc` because not every system is POSIX compatible.
-rw-r--r--library/std/src/net/tcp.rs2
-rw-r--r--library/std/src/net/udp.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs
index 06ed4f6a03d..f81a13d4c44 100644
--- a/library/std/src/net/tcp.rs
+++ b/library/std/src/net/tcp.rs
@@ -561,7 +561,7 @@ impl TcpStream {
 
     /// Moves this TCP stream into or out of nonblocking mode.
     ///
-    /// This will result in `read`, `write`, `recv` and `send` operations
+    /// This will result in `read`, `write`, `recv` and `send` system operations
     /// 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
diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs
index 8c9e31f9c15..b78e52023b3 100644
--- a/library/std/src/net/udp.rs
+++ b/library/std/src/net/udp.rs
@@ -764,7 +764,7 @@ impl UdpSocket {
 
     /// Moves this UDP socket into or out of nonblocking mode.
     ///
-    /// This will result in `recv`, `recv_from`, `send`, and `send_to`
+    /// This will result in `recv`, `recv_from`, `send`, and `send_to` system
     /// operations 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