Reading from socket file handle took too long

Ben Sizer kylotan at gmail.com
Mon Feb 27 05:33:08 EST 2006


Etienne Desautels wrote:
> Everything works well but one thing. My problem is that running
> nextFrame() took, most of the time, more then 0,0414 sec. so my video
> is lagging. I monitor every call and I found that the culprit is when I
> read from the socket file handle. It's the only bottleneck in my code.

If you're sure this is the problem, you might try calling setSockOpt on
the socket to set the nodelay flag, something like this:

mySocket.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)

I don't know enough about the option to be sure it'll work, but it
can't hurt to try.

-- 
Ben Sizer




More information about the Python-list mailing list