develooper Front page | perl.perl5.porters | Postings from January 2004

[perl #24892] alarm not working with Windows XP

From:
Wu, Ann
Date:
January 12, 2004 20:12
Subject:
[perl #24892] alarm not working with Windows XP
Message ID:
rt-3.0.8-24892-69972.2.10144828003891@perl.org
# New Ticket Created by  "Wu, Ann" 
# Please include the string:  [perl #24892]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=24892 >


Hi,

 

I have a perl script for Windows XP using alarm, but the alarm doesn't
seem to work.  I found [perl #24739] is another discussion for this
problem.  However, Terry Grieb said it supports to work for XP.  I'm
enclosing a segment of my code that setup & catch the alarm signal.
Would you please take a look and let me know if I have a bug in my code,
or alarm doesn't work for Windows XP either.  Thank you very much!!!

 

====  cut sample code  =====

 

 $SIG{ALRM} = sub {

     close SOCK; 

     print "timeout\n";

     die;

};

 

.... Setup socket ...  (this part work)

alarm 10;   # alarm wait for 10 seconds.

.... Write to the socket & wait for reply from the socket, but the
socket never replied, and the $SIG{ALRM} subroutine never was called.

 

====  end sample code  ====




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About