Sys-AlarmCall - alarms don't work on vms

Posted on Wed Nov 14 09:25:35 2007 by gnuey
alarms don't work on vms
See attached perl script. It creates a network port and waits for connections. It is suppose to time out in 30 seconds. The program works on Linux and on HPUX. But doesn't work on VMS. It never times out on VMS.
On Linux: # perl setalarm.pl setting alarm 1. process timed out at setalarm.pl line 10. closing socket On VMS (perl 5.8.6 with ECO1): $ perl setalarm.pl setting alarm Perl script: use IO::Socket::INET; my $server = IO::Socket::INET -> new ( LocalPort => 5556, Type => SOCK_STREAM, Reuse => 1, Listen => 30); eval { local $SIG{ALRM} = sub { die "process timed out"; }; print "setting alarm\n"; alarm 10; eval { my $client => $server -> accept(); }; alarm 0; print "1. $@\n" if ($@); }; alarm 0; print "2. $@\n" if ($@); print "closing socket\n"; close ($server);
Direct Responses: 6456 | Write a response