Stopping Windows Service
larry.bates at websafe.com
Sat Mar 4 00:06:31 CET 2006
> Sorry for the many messages, but I've been looking into it further -
> since I have the server services listening and waiting for incoming
> connections, how would I interrupt it to let the program know that a
> stop request has been issued? For example, if I put the stop check
> before it listens, I would think it'd have to wait until it loops back
> around after the next client connects. If I put it after the listen, a
> client would have to connect in order for it to run the check..?
You are correct. Services must be "good neighbors". They
do some work and go to sleep for some period of time, then wake
up and loop. The stop signal comes while they are asleep.
When they wake up, they exit the infinite loop. If you can't
implement a listen-with-timeout it is going to be hard to make
this into a service.
More information about the Python-list