Skip to content

Commit

Permalink
Rollup merge of rust-lang#130743 - YohDeadfall:net-nonblocking-doc, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

Clarifications for set_nonblocking methods

Closes rust-lang#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.
  • Loading branch information
GuillaumeGomez authored Sep 29, 2024
2 parents a31f882 + 6d41b99 commit e36be64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion std/src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion std/src/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e36be64

Please sign in to comment.