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

[perl #24892] alarm not working with Windows XP

Wu, Ann
January 12, 2004 20:12
[perl #24892] alarm not working with Windows XP
Message ID:
# New Ticket Created by  "Wu, Ann" 
# Please include the string:  [perl #24892]
# in the subject line of all future correspondence about this issue. 
# <URL: >



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";




.... 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  ==== Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About