]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] 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:58 +0000 (01:50 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 00:50:58 +0000 (00:50 +0000)
commitfe0f544f33adf6128400f103187ba9f3cee13549
tree7440f3870f84cadaf2eced830382c8be0565cde2
parente66ad91f68b68fc8cbdc4b6dacea80636164cdf5
[3.11] gh-111112: Avoid potential confusion in TCP server example. (GH-111113) (#114832)

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