Closed
Description
Documentation
Issue (on https://docs.python.org/3/library/socketserver.html#socketserver-tcpserver-example):
self.data = self.request.recv(1024).strip()
print("{} wrote:".format(self.client_address[0]))
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.