Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TcpStream::set_nonblocking docs mention non-existent methods #129903

Closed
Imberflur opened this issue Sep 2, 2024 · 4 comments · Fixed by #130743
Closed

TcpStream::set_nonblocking docs mention non-existent methods #129903

Imberflur opened this issue Sep 2, 2024 · 4 comments · Fixed by #130743
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@Imberflur
Copy link

Location

/// This will result in `read`, `write`, `recv` and `send` operations

Summary

The docs mention:

This will result in read, write, recv and send operations becoming nonblocking

However, I can't find any recv or send methods on TcpStream (nor in the traits it implements). Do these operations refer to something else?

@Imberflur Imberflur added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Sep 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 2, 2024
@bjorn3
Copy link
Member

bjorn3 commented Sep 2, 2024

It is likely referring to the underlying syscalls on UNIX systems.

@the8472
Copy link
Member

the8472 commented Sep 2, 2024

BSD socket APIs are defined in POSIX, also referenced and extended in various IETF RFCs. Windows also adopted it. So it's pretty much the universal API describing how to interact with various kinds of network sockets.

But at least read does appear in the documentation.
https://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read-1

@Imberflur
Copy link
Author

It is likely referring to the underlying syscalls on UNIX systems.

Oh I see. Thank you for helping with my confusion. I'm happy to close this then (but also fine with keeping it open if it seems worth clarifying this in docs).

@lolbinarycat lolbinarycat added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 5, 2024
@rufevean
Copy link
Contributor

rufevean commented Sep 6, 2024

do we just have to add comments to clarfiy better or is there any docs file that we have to change too?

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 28, 2024
…=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.
@bors bors closed this as completed in ee8ca3a Sep 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 29, 2024
Rollup merge of rust-lang#130743 - YohDeadfall:net-nonblocking-doc, r=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.
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants