asyncore.loop As A Win32 Service

John Abel johnfabel at btinternet.com
Mon Mar 24 19:15:47 CET 2003


Hi,

I'm writing a service, and have come across a problem with 
asyncore.loop.  There doesn't seem to be a way for it to interrupted, 
when the service is issued a stop.  To get round this with a similar 
program using SocketServer, before executing handle_request I checked 
for connections with select.select().  The way I'm thinking of doing it, 
is to override asyncore.loop, set an event, launch the new asyncore.loop 
in a thread, and replace the while 1 in asyncore.loop with a check for 
the event.  Does that sound about the right to go about it?

Thanks

John






More information about the Python-list mailing list