This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Thorben, giampaolo.rodola, pitrou, thorben
Date 2008-09-11.16:25:07
SpamBayes Score 1.5134901e-07
Marked as misclassified No
Message-id <1221150332.52.0.767637122156.issue3766@psf.upfronthosting.co.za>
In-reply-to
Content
You can use setsockopt() to set the TCP_NODELAY flag and see if that
improves things; sending thousands of 4-bytes packets isn't exactly the
expected utilization of TCP.

As I said, socket.recv() is just a thin wrapper above the same-named C
library function. Your code expects the kernel's TCP stack to send
things as soon as you ask it to, but TCP is a high-level stream protocol
and implementations usually have sophisticated algorithms in order to
minimize the number of individual packets sent over the wire.

By the way, if you want to build network applications (clients and
servers), I suggest you take a look at the Twisted framework. It will
free you from many low-level issues, although it won't prevent you from
shooting yourself in the foot :-)
History
Date User Action Args
2008-09-11 16:25:32pitrousetrecipients: + pitrou, giampaolo.rodola, Thorben, thorben
2008-09-11 16:25:32pitrousetmessageid: <1221150332.52.0.767637122156.issue3766@psf.upfronthosting.co.za>
2008-09-11 16:25:08pitroulinkissue3766 messages
2008-09-11 16:25:07pitroucreate