views:

29

answers:

1

I have an instance of SimpleHTTPServer, however when I try to call "shutdown" on it and there is a request handler that is blocked - the whole process will block.

It does so even if I run the "serve_forever" method in a deamon thread.

See example code at http://codepad.org/cn8EYdfg

Any advice?

A: 

the shutdown method won't take affect until after the GET request is processed.

And that request is blocking because of the queue operation.

Maybe this will help: Stoppable Interruptable Python HTTP Server

HS
I've modified my code to fit what the post suggest (http://codepad.org/OV6zDRET), and it works. Thanks!
lazy1