Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion sockets,threads and interupts
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
loial  
View profile  
 More options Sep 4 2012, 11:26 am
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.