Hi,

What version of ActivePerl are you using?  I don't know about version 5.8,
but version 5.6 doesn't support alarm(), e.g. this is the output I get:

C:\temp>perl x.pl
The Unsupported function alarm function is unimplemented at x.pl line 3.
        ...propagated at x.pl line 8. 

good luck!

-----Original Message-----
From: Stadler Stephan
To: [EMAIL PROTECTED]
Sent: 8/25/2003 4:10 AM
Subject: TIMING OUT OF AN HTTP response 


I wanted to put a timeout on the section of code which sends the POST 
request. If after 3 minutes I receieved no response I wanted to exit the
program.

I saw some code in "Advanced Perl 
Programming" which uses eval and alarm to achieve this.

...
eval{
    local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required    
    alarm(2);    
    $result = $ua->request($req);
    alarm(0);
};
if ($@) {
    die unless $@ eq "alarm\n";   # propagate unexpected errors
    exit(0);
 }
 else {
     # didn't
 }
...

but the request is blocked and the alarm() is not been exevuted after 2
seconds - why?


Many thanks,stephan


 

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to