[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] network



Jasper Phillips wrote:
Besides, what other alternative is there?  Python's socket module?!
I'm just curious on this one. I've never done any network programming farther than testing a connection and passing a string or two back and forth. I've heard people say that socket level programming is bad, but never the reasons why.

I've read code that uses both sockets and twisted, and personally, the vanilla sockets always looks like a win to me. The benefit of twisted is that it supports about every protocol in use. But if you are just going to be passing your own message types over the socket, why bother?

When you say you prefer twisted, how are you using it? Isn't it just some tool for "send a message", "has a message arrived"? How is that better than socket with select? Or if you need, the asyncore module has already tied those together for you.

The Twisted documentation I've read starts like "you don't write applications that use twisted, you write libraries that plugin to it".

Personally, I still intend to use sockets at some point when I add networking to a game. :]