Stopping SocketServer on Python 2.5
garrickp at gmail.com
Wed Mar 11 18:57:28 CET 2009
On Mar 10, 7:19 pm, David George <d... at eatmyhat.co.uk> wrote:
> So, my question is, is there any way to stop a SocketServer that's been
> told to server forever in python 2.5?
serve_forever, in python 2.5, is simply coded as:
So, instead of calling serve_forever, call handle_request in your own
loop with a shutdown flag. Assuming, of course, that you aren't using
the Forking server, in which case things get more interesting.
More information about the Python-list