makefile('rb') return a  io.BufferedReader and the 
doc( says:
    If the argument is positive, and the underlying raw stream is not 
interactive, multiple raw reads may be issued to satisfy the byte count (unless 
EOF is reached first).
------------------ Original ------------------
From:  "Steven D'Aprano"<>;
Date:  Sun, Feb 4, 2018 09:31 PM
To:  "python-list"<>;
Subject:  Re: Why not have a recvall method?
On Sun, 04 Feb 2018 19:26:36 +0800, 陶青云 wrote:

> Hello, allThe socket object has a `sendall` method that can send all
> bytes you specified. Oppositely, socket only has a recv method. I wonder
> why there is not a `recvall` method? To workaround this, I use `f =
> socket.makefile('rb')`, then `call` Thanks.

I am not an expert on sockets, but since will read a maximum of 
n bytes, isn't that the same as socket_obj.recv(n)?



Reply via email to