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

Re: [pygame] Re:[pygame] networking example



I found the twisted docs a bit hard to follow and wound up building
something on asynchat.

http://docs.python.org/lib/module-asynchat.html

Here is a simple example:
Server: http://rafb.net/p/kU58yg32.html
Client: http://rafb.net/p/sI2FRw42.html

   Starting with something like that it's just a matter of defining
your state machine and the messages you are going to send. Have your
client generate some pygame events, stick the client's asyncore.poll
in your pygame loop and away you go. I'm sure it's not very robust or
secure but it was a good way for me learn about network programming.

On Sun, Apr 27, 2008 at 9:33 AM, Patrick Mullen <saluk64007@xxxxxxxxx> wrote:
>
> Found you an exe and an egg:
> http://www.zope.org/Members/saffe/zope_interface/folder_contents
>
> Really annoying when binaries stop being updated.
>
> You could also just use sockets of course, they aren't that difficult
> really.
>
> Also, raknet uses udp, but it has built-in workarounds for all of udp's
> problerms.  It can send both reliable packets, and break through NAT's,
> which are the two most difficult issues with using UDP.  Messaging is
> actually easier with UDP because you send datagrams (messages) instead of a
> constant stream of bits.
>
> Good luck!
>