asyncore 
Author Message
 asyncore

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.



Mon, 15 Sep 2003 19:04:44 GMT  
 asyncore

Quote:

> - 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 ?

If your sockets are blocking, I suspect that you didn't use
asyncore.create_socket() to create them.  If so, try that.

You might want to  take a look at asynchat.py as well.  It doesn't seem to
be in the python Library documentation, but it uses asyncore and handles a
lot of the dirty work.

You might also get some use out of asynchttp which uses asyncore and
asynchat.  http://asynchttp.sourceforge.net

--


Senior Meat Manager
Downright Software LLC
http://www.dougfort.net



Mon, 15 Sep 2003 20:18:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. tkinter asyncore.loop

2. asyncore 100% cpu usage?

3. asyncore problem

4. asyncore: limiting number of simultaneous connections?

5. asyncore sockets and proxy

6. Tkinter, asyncore - Two questions

7. Integrating SimpleHTTPServer into asyncore

8. asyncore.dispatch_with_send bug

9. asyncore, timeoutsocket

10. asyncore: where is handle_timeout() ?

11. Stupid Q: asyncore and disconnecting?

12. asyncore: select on UDP socket question

 

 
Powered by phpBB® Forum Software