sockets: How to know when your data is sent

Grant Edwards grante at visi.com
Wed Nov 10 16:27:32 CET 2004


On 2004-11-10, Jaime Wyant <programmer.py at gmail.com> wrote:
> On 09 Nov 2004 17:26:03 GMT, Grant Edwards <grante at visi.com> wrote:
> [ snip! ]
>> Unfortunately, many people who write network applications (and
>> protocols) make all sorts of bizarre assumptions, and somebody
>> ends up jumping through hoops later to try to fix things when
>> those assumptions turn out to be wrong. :/
>
> Woah!  This is all enlightening news to me.  Of course, what little
> bit of socket level stuff I've done, I've always had a
> "send/acknowledge" type protocol wrapped around.  I guess I've just
> been lucky so far :-).

While we're on the topic, another common problem occurs when
people assume that there is a 1:1 correspondance between
write() and read() operations when using TCP.  IOW, they assume
that if they write() (or send()) a block of data of size N,
that it will arrive at the other end as a block and be read as
a block of size N.  Under some conditions, this will often be
true.  I ran into one app that worked under this assumption for
years, but broken when a satellite link was placed in the path.

-- 
Grant Edwards                   grante             Yow!  With YOU, I can be
                                  at               MYSELF... We don't NEED
                               visi.com            Dan Rather...



More information about the Python-list mailing list