New submission from K Richard Pixley <r...@noir.com>:

Once I've instantiated my server class, along with a handler class, called 
server.serve_forever(), handler.handle() has been called, I've done my work, 
and I'm ready to shut the whole thing down...

How do I do that?

The doc says server.shutdown(), but if I call self.server.shutdown() from 
within handler.handle(), I seem to get a deadlock, which is exactly what I'd 
expect in a single threaded system with no way to "signal" the 
server.server_forever() loop which is several frames up the stack.

I've also tried sys.exit() but it seems that the server object is catching that 
as an exception.

How is this expected to work?  How do I terminate the server.serve_forever() 
loop?

Both 3.2 and 2.7 appear to behave the same way.  The documentation is confusing 
here as it doesn't explain what is expected to happen in this case.

----------
components: Library (Lib)
messages: 150965
nosy: teamnoir
priority: normal
severity: normal
status: open
title: socketserver can't stop
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13749>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to