pygame and socket.recv

Aaron Brady castironpi at gmail.com
Fri Apr 3 00:55:48 CEST 2009


On Apr 2, 10:12 am, Miguel Prada <miguel.regis... at gmail.com> wrote:
> I don't know if this might be causing your problem, but most socket
> implementations use quite a big buffer for incoming data by default. I
> had a lot of trouble with another real-time networked application
> until I realised this. Reducing this buffer to the minimum helped a
> lot in my case. Also, I would strongly recommend using UDP instead of
> TCP.
>
> BTW, does anyone know if any good bibliography about real-time
> networked games, or real-time networked general applications?

I switched to UDP.  My average round-trip time is at 50 trips/sec, but
my worst round-trip time is still in the 10-20 range.

I also tried buffer sizes of 2**8 and 2**12, with about the same
results.

So, UDP might free up some processor time, but it still leaves me with
the problem of retroactive model updates.



More information about the Python-list mailing list