Flatland ARG!!!

Blog

Notes on Networking

There were several choices for doing networking on the Nokia tablets
in python. Several open source projects exist for networking on
python including Twisted which came with a huge amount of features for
handling networking. However, since the data to synchronize was so
simple, we opted to build a networking module from scratch from the
basic socket library. Data would be sent as c strings in key value
pairs separated by a special character. Writing the library proved to
be a cumbersome task and involved dealing with several threading and
synchronization issues. The finished product was functional but
cumbersome to use in code and incredibly slow. We weren’t sure at the
time how much of the slowness was due to the implementation and how
much was due to the unavoidable latency in the network. Writing a
networking module from scratch did teach us a lot about working with
the Nokia tablets as well as networking in general, particularly for
the purpose of game programming. While the fundamental core of the
networking was solid, i.e. messages could be sent and received
reliably, the overhead incurred by the straight forward implementation
proved to be significant. In addition, using the network module proved
to be a very cumbersome task suggesting that a much more intuitive and
robust interface was needed for a good networking module.