Advertisement

Python Networking

Started by July 31, 2006 12:04 PM
4 comments, last by doctorsixstring 18 years, 6 months ago
I've been playing around with the Python socket module for the last few days. I'm working on a design for a networked event manager for use in a lock-step, peer-to-peer RTS game. Apart from a few confusing points, the socket module seems pretty straight-forward and easy-to-use. It doesn't seem like it would take too much time to program what I need. On the other hand, there are a few other modules/libraries that seem pretty useful, like Twisted, asyncore, and SocketServer. I don't want to reinvent the wheel, but it doesn't look like much code is needed to build my own networked event manager. Would it be worth spending time to learn and implement one of these pre-built frameworks? What benefits would I gain? I would love to hear from anyone that has first-hand experience with one of these libraries (or any other library, for that matter). - Mike
There are several bindings from RakNet to python you could try =)
--
Advertisement
RakNet looks very nice. I'll give it a try.
I found PyRakNet, but it uses the GPL license, which would prevent me from using it in a closed-source commercial game (right?).

Are there any other Python bindings to RakNet? I suppose I could write my own (I've played around with Boost::Python), but that would somewhat defeat the purpose of using a third-party library.
Writing your own wrapper for an existing library is significantly less complex than writing your own library. Thus, even if you had to wrapper it yourself, the purpose of the third party library (use tested code that someone else wrote) is not defeated.
enum Bool { True, False, FileNotFound };
I suppose you're right. I've been having a lot of fun playing with sockets, but I imagine the fun will be short lived. I don't think I'll enjoy the heavy testing and optimization (via Pyrex or Boost::Python) that will be required later.

Plus, RakNet would give me stuff like autopatching, voice chat, and data compression for free.

I'm going to the Wisconsin State Fair tonight, but maybe tomorrow night I'll take a stab and Pyrex wrapper for RakNet.

This topic is closed to new replies.

Advertisement