Skip to content

[3.12] gh-111112: Avoid potential confusion in TCP server example. (GH-111113) #114831

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

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 1, 2024

Improve misleading TCP server docs and example.

socket.recv(), as documented by the Python reference documentation,
returns at most bufsize bytes, and the underlying TCP protocol means
there is no guaranteed correspondence between what is sent by the client
and what is received by the server.

This conflation could mislead readers into thinking that TCP is
datagram-based or has similar semantics, which will likely appear to
work for simple cases, but introduce difficult to reproduce bugs.
(cherry picked from commit a79a272)

Co-authored-by: Aidan Holm [email protected]


📚 Documentation preview 📚: https://cpython-previews--114831.org.readthedocs.build/

…thonGH-111113)

Improve misleading TCP server docs and example.

socket.recv(), as documented by the Python reference documentation,
returns at most `bufsize` bytes, and the underlying TCP protocol means
there is no guaranteed correspondence between what is sent by the client
and what is received by the server.

This conflation could mislead readers into thinking that TCP is
datagram-based or has similar semantics, which will likely appear to
work for simple cases, but introduce difficult to reproduce bugs.
(cherry picked from commit a79a272)

Co-authored-by: Aidan Holm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants