En Tue, 17 Jun 2008 14:32:44 -0300, John Salerno <[EMAIL PROTECTED]> escribió:

> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Note that most of the time you want to use the sendall() method, because
>> send() doesn't guarantee that all the data was actually sent.
>> <http://docs.python.org/lib/socket-objects.html>
>
> If I use sendall(), am I still recv'ing data with a given buffer size? What
> if I send more data than the buffer size. Is my code as written not prepared
> to handle that case? It seems like I might need to continue receiving data
> until there is no more to receive (in a loop?)...is that right?

send and recv are separate calls (they occur usually in different processes, 
even in different computers). Buffer sizes are separate too. It is posible to 
send 5K at once from one side, and require three recv calls on the other side 
to read it completely. On the other hand, if you try to read from a blocking 
socket (the default state) when no data is available, the read call will block 
(and the whole program freezes) until some data is received. There are several 
alternatives to avoid this, and surely they're explained in detail in a later 
chapter in your book...

-- 
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to