Skip to content

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