[Twisted-Python] Q about handling CTRL-C correctly

Stefan Näwe naewe.s at atlas.de
Tue May 3 03:42:13 EDT 2005


Hi.
I'm new to twisted.
I'm trying to create a simple twisted server that sends some telegrams
(created with struct.pack()) every second to the connected clients.
Attached is what I came up with so far.

My problem is, that I don't know how to handle CTRL-C correctly. If
I run my test server and press CTRL-C while a client is connected I get
something like:


2005/05/03 09:23     [__main__.SimpleFactory] Received SIGINT, shutting
down.


and that's it. The server simply keeps running. But I want it to
shutdown. I hope someone can help me.

Thanks

Stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_twisted.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050503/1f828e97/attachment.txt 


More information about the Twisted-Python mailing list