ALARM on windows? 
Author Message
 ALARM on windows?

I'm having trouble handling SIGALRM under windows!

I'd like to do the following : A python script listens to port 6664(for
example). When it gets a connection, it then sets an alarm handler and then
tries to read from the socket. If it does not get data within 10 seconds, it
then times out, at which point the alarm handler throws an axception and
aborts the socket read.

The problem is that I don't know how to handle signals under WINDOWS.

Any ideas?

Thanks in advance.
Kalis.



Fri, 04 Jul 2003 18:54:38 GMT  
 ALARM on windows?

Quote:

> I'd like to do the following : A python script listens to port 6664(for
> example). When it gets a connection, it then sets an alarm handler and then
> tries to read from the socket. If it does not get data within 10 seconds, it
> then times out, at which point the alarm handler throws an axception and
> aborts the socket read.

   Use timeoutsocket from http://www.timo-tasi.org/python/

Oleg.
----

           Programmers don't die, they just GOSUB without RETURN.



Fri, 04 Jul 2003 19:25:36 GMT  
 ALARM on windows?

Quote:

> I'm having trouble handling SIGALRM under windows!

> I'd like to do the following : A python script listens to port 6664(for
> example). When it gets a connection, it then sets an alarm handler and then
> tries to read from the socket. If it does not get data within 10 seconds, it
> then times out, at which point the alarm handler throws an axception and
> aborts the socket read.

> The problem is that I don't know how to handle signals under WINDOWS.

SIGALRM is not available in the signal module under Windows. In Python 2.0
there is asyncore module available (asynchronous socket handler). I imagine
that this will help to solve your problem.

Andreas



Fri, 04 Jul 2003 19:33:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Timer Control and Alarm - Warning extreme Newbie

2. How to sound alarm after interval of time?

3. Any Software for Security (Alarm) companies (UK) available

4. I am having touble logging alarm status in labview

5. ?? CHR(7) = Alarm

6. best way to display alarm histories in Labview6?

7. modem and alarm

8. alarm timer

9. Fire The Boss And Break the Alarm Clock!

10. Alarm delay problem

11. connect a alarm event to a analog output

12. connect alarm event to an analog output

 

 
Powered by phpBB® Forum Software