Asyncore Help?

Paul Kozik zykhou at gmail.com
Mon May 14 00:51:51 EDT 2007


I am working on the networking code for a small Multiplayer RPG I'm
working on. I currently have some basic code using threads, but it
seems like asyncore would be far better suited for my needs. However,
I have trouble finding a solid example for what I need. Python.org and
other sites provide simple examples, but they appear more intended for
servers that simply send one peice of data to the client.

I want to have a server program that is willing to accept commands
sent from the client, and repeatedly wait for data and respond.
Maintaining a long term connection until the client is done playing.

Besides this I am also stuck with dealing with TCP data streams. I can
receive and send the data (using threads, not yet with asynocore), but
I am unsure how to deal with the streamlike nature of TCP (and would
prefer to use TCP over UDP). I would like to have it so that the
client sends the server a command (such as update position), and then
the data, and have the server update that information on its side
accordingly.

While basic socket work was rather easy to deal with, this has proved
significantly more difficult. Are there any good free sources for
information on Asyncore, and dealing with TCP?



More information about the Python-list mailing list