]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-111112: Avoid potential confusion in TCP server example. (#111113)
authorAidan Holm <alfh@google.com>
Thu, 1 Feb 2024 00:42:38 +0000 (08:42 +0800)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 00:42:38 +0000 (16:42 -0800)
commita79a27242f75fc33416d4d135a4a542898d140e5
tree34ac0e65ee88f65a4790b648ff2fe6ea69f8648f
parent80aa7b3688b8fdc85cd53d4113cb5f6ce5500027
gh-111112: Avoid potential confusion in TCP server example. (#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.
Doc/library/socketserver.rst