[..]
https://coderanger.net/svn/school/2007/fall/egd/magnoball/
pygamenet.py
. Also a WiP.
PyQNet is split over 8 modules, but the actual number of code-lines
in
the library (excluding the tests) is pretty small (640 incl. comments
and docstrings), pygamenet is around 591 when you take out the
comments. Though PyQNet is likely to grow substantially once I get
all
the features I want implemented.
The difference in size currently is likely because PyQNet is
implemented
as UDP with ordering and retry controlled by the Python code
instead of
using TCP-level operations. The UDP operations should allow us to
code
adaptations into the library to optimize for low-latency game-y
operation.
This is a common misconception. The reason to use UDP is not for low-
latency
(just set TCP_NODELAY), but to accommodate lossy links. Generally
this means
dealing with either bad connections or high congestion. And when I
say "deal
with" I mean "detect and die", not just reimplementing
retransmission on top
of UDP. As it stands there is no real reason to use UDP for games
anymore
unless you really think the vast majority of your users will be on bad
connections. I don't think this is the case, even for OLPC (sat
links are
slow, but generally not lossy).