On Sun, Feb 4, 2018 at 5:26 AM, 陶青云 <qingyun....@tophant.com> wrote:
> Hello, all
> The socket object has a `sendall` method that can send all bytes you
> 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 all `f.read(n)`
You're probably good with socket.makefile('rb').
An alternative that allows things like reading null-terminated input:
I wrote it and have been using it in production for years.