Socket Question

Grant Edwards grante at visi.com
Wed May 30 23:31:00 EDT 2001


On Wed, 30 May 2001 19:11:57 -0700, Daniel Klein <danielk at aracnet.com> wrote:

>Just when I thought I wouldn't have to learn something else... :-)
>
>I've been going thru the socket tutorial in Mark Lutz's PP2E
>(great book btw). It appears that the buffer limit for recving
>data is 1k.

What type of sockets are you using?  TCP? UDP?

>I tried recving more and it just truncates it. Is this a
>function of sockets in general or is there some setting I can
>tweak to force it to accept more?

If you're using UDP, you can't generally count on chunks larger
than 512 bytes working.  

If you're using TCP, the size of the chunks you read may vary.
You have to deal with the data stream being delivered in
whatever size chunks please the intervening software and
hardware (regardless of what size chunks with which it was
written).

-- 
Grant Edwards                   grante             Yow!  Now, I think it would
                                  at               be GOOD to buy FIVE or SIX
                               visi.com            STUDEBAKERS and CRUISE for
                                                   ARTIFICIAL FLAVORING!!



More information about the Python-list mailing list