P
peco
Hello,
I have the following code:
eval
{
local $SIG{ALRM} = sub { die ;};
alarm(3);
while (<CMD>)
{
$oldvar= $_;
}
alarm(0);
};
CMD is an open pipe that ssh-es to a list of servers and retrieves a
value. If ssh connection takes too long the intention is to kill it and
proceed with the rest on the list. The problem is that alarm works only
on the first slow connection. Subsequent iterations that take longer
than 3 seconds do not time out. I have found several posts regarding
this but nothing has worked so far. I understand this is architecture
dependant implementation but so far I am unable to find the right
incantation for Solaris 9.
Thanks!
I have the following code:
eval
{
local $SIG{ALRM} = sub { die ;};
alarm(3);
while (<CMD>)
{
$oldvar= $_;
}
alarm(0);
};
CMD is an open pipe that ssh-es to a list of servers and retrieves a
value. If ssh connection takes too long the intention is to kill it and
proceed with the rest on the list. The problem is that alarm works only
on the first slow connection. Subsequent iterations that take longer
than 3 seconds do not time out. I have found several posts regarding
this but nothing has worked so far. I understand this is architecture
dependant implementation but so far I am unable to find the right
incantation for Solaris 9.
Thanks!