
On Mon, May 26, 2008 at 6:02 PM, Ralph Meijer twisted@ralphm.ik.nu wrote:
On Mon, 2008-05-26 at 15:03 +0200, Jo Vermeulen wrote:
[..]
I had another question about the Jabber example (xmpp_client.py) in Twisted words. When I quit the application with Ctrl+C, it throws an exception:
[..]
I haven't seen that behavior before, but I can confirm this happens. I poked around a bit with the example. It seems that the socket is closed before its factory is shut down. It might be that the reactor shutdown procedure has changed, so I think this behavior is the result of a bug, either in the example or somewhere else. It needs more investigation, so it would be nice if you could file a ticket for it.
Done: http://twistedmatrix.com/trac/ticket/3270
Is there any way to modify this example so that it stops gracefully when Ctrl+C is pressed? Embedding the main script code in a try-except statement that catches KeyboardInterrupt doesn't help since Twisted seems to catch all exceptions itself.
I don't know of a good solution, at the moment. If the above bug gets resolved, you shouldn't need to do anything beyond that.
OK thanks!
-- Jo