how to stop a server (TCPServer, for example)

Skip Montanaro skip at
Tue Aug 21 18:01:33 CEST 2001

    Huayin> How to make the server clean itself up and exit?
    Huayin> Do I need to implment an exit method for the server?

That's typical.  In my serve_forever method I have (effectively)

    while self.serving:
        r,w,e =[self.socket], [], [], self.pause)
        if r:

My exit method simply sets self.serving to 0.

Skip Montanaro (skip at

More information about the Python-list mailing list