diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/socketserver.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst index 7540375..5e92332 100644 --- a/Doc/library/socketserver.rst +++ b/Doc/library/socketserver.rst @@ -488,7 +488,7 @@ This is the server side:: def handle(self): # self.request is the TCP socket connected to the client self.data = self.request.recv(1024).strip() - print("{} wrote:".format(self.client_address[0])) + print("Received from {}:".format(self.client_address[0])) print(self.data) # just send back the same data, but upper-cased self.request.sendall(self.data.upper()) @@ -519,8 +519,9 @@ objects that simplify communication by providing the standard file interface):: The difference is that the ``readline()`` call in the second handler will call ``recv()`` multiple times until it encounters a newline character, while the -single ``recv()`` call in the first handler will just return what has been sent -from the client in one ``sendall()`` call. +single ``recv()`` call in the first handler will just return what has been +received so far from the client's ``sendall()`` call (typically all of it, but +this is not guaranteed by the TCP protocol). This is the client side:: |