The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.python
From: loial <jldunn2...@gmail.com>
Date: Tue, 4 Sep 2012 08:26:21 -0700 (PDT)
Local: Tues, Sep 4 2012 11:26 am
Subject: sockets,threads and interupts
I have threaded python script that uses sockets to monitor network ports.
I want to ensure that the socket is closed cleanly in all circumstances. This includes if the script is killed or interupted in some other way.
As I understand it signal only works in the main thread, so how can I trap interupts in my threaded class and always ensure I close the socket? Using KeyboardInterupt does not seem to work.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||