asyncore

Matias GUIJARRO matias.guijarro at utbm.fr
Thu Mar 29 06:04:44 EST 2001


Hello group :-)

I'm using the asyncore library in order to make a simple network card
game.

I'm relatively new to sockets programming, however I think the asyncore
library provides a very efficient way to what I'd like to obtain.

Here are my questions/problems :
- The server must be always listenning for new connections, so I call
the
asyncore.loop() method, but it seems to be "blocking" : the code after
isn't
executed. How can I make an "asyncronous" listenner ?
- Due to this behaviour, I can't develop my app under Windows because
every time I test it, the OS "hangs up", listenning for connections...
(I use IDLE and I directly execute the code with CTRL-F5).
- I don't really want to make a server very different from a client ;
before
the game one of the players says he's the server, then every client
connect
to him : that's what I expect.  What is the best solution for doing so ?

- Moreover, I build my GUI with Tkinter (I'm learning Python, so I
thought
Tkinter was more accessible, even if it's surely not the best), and
there is
also a loop for the Tkinter events (root.mainloop()), how can I have the
two
loops (asyncore.loop & this one) working as background processes ?
Using threads (thread module) in Windows isn't a good solution, it's too
slow
and sometimes the OS hangs up too !

If someone can help me about these questions, I will appreciate it a
lot.

Thanks in advance.




More information about the Python-list mailing list