]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-111112: Avoid potential confusion in TCP server example. (GH-111113) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 1 Feb 2024 00:50:34 +0000 (01:50 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 00:50:34 +0000 (00:50 +0000)
commit21b68a1198fbfada3d3c11576c0f9676a4cf5978
tree28082b5ab4dae3ef8382895c58d01c349402604c
parentc8e4c32105aff5c762ee3602426603212dcbcd40
[3.12] gh-111112: Avoid potential confusion in TCP server example. (GH-111113) (#114831)

gh-111112: Avoid potential confusion in TCP server example. (GH-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 a79a27242f75fc33416d4d135a4a542898d140e5)

Co-authored-by: Aidan Holm <alfh@google.com>
Doc/library/socketserver.rst