Question : cannot receive the timeout message when telnet fails, WHY?

i use a normal telnet script like that:
sub blabla {
$telnet = new Net::Telnet (
                                Host => "$host",
                                Errmode=> "return",
                                Prompt => "/$node>/");
if (!$telnet) {$alarm .= "Cannot telnet to $node, ";return;}# exit the sub if can not telnet
}

i telnet to 15 unix host, one after onother, but one of them (named A) i cannot telnet to (e.g when it is turned off)
but i can not get the timeout error to escape, the script is hang and when i check on my local host:
netstat -an|grep
i get:
.40621   .23         0      0 49640      0 SYN_SENT
which mean the script cannot receive the error message which indicate timeout for me to go further
if i turned of another host, it works fine after 10 seconds trying
what's happening? and what to do to deal with SYN_SENT ??



Answer : cannot receive the timeout message when telnet fails, WHY?

I'm not sure what is causing the problem.  The Net::Telnet module might internally use the alarm to control it's timeouts - which would prevent the alarm before it from working...
Random Solutions  
 
programming4us programming4us