[Python-ideas] socket.sendall() "counter" parameter

Masklinn masklinn at masklinn.net
Fri Apr 18 14:50:44 CEST 2014


On 2014-04-18, at 14:35 , Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Fri, 18 Apr 2014 14:28:22 +0200
> "Giampaolo Rodola'" <g.rodola at gmail.com>
> wrote:
>> 
>> 2 - in case of error set a "sent" attribute to the returned (socket.error)
>> exception.
> 
> If you want to write the logic to re-send the remaining data on error,
> why not also write the logic to use send() and re-send the remaining
> data on success? AFAICT, it's the same logic.

sendall keeps trying to send stuff until finished or there's an error,
so surely there's no point in wrapping *that* in yet an other send loop?

But the amount of data which was successfully sent can be useful for
reporting, logging, or to check whether complete segments were sent
(if the protocol provides such a thing).


More information about the Python-ideas mailing list