Skip to content

Commit

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

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.
  • Loading branch information
GuillaumeGomez authored Sep 29, 2024
2 parents ed5d779 + e424a8c commit ee8ca3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/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 library/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 ee8ca3a

Please sign in to comment.