in reply to Net::Telnet timeout fails
Which version of Net::Telnet are you using? The version I am using is 3.03. The following is an extract from the module -printf "%s\n", $telnet->errmsg();
The module code will try to resolve the host IP before making a connection with inet_aton, create socket, and connect to the specified server.## Connect to server, timing out if it takes too long. eval { ## Turn on timer. local $SIG{"__DIE__"} = "DEFAULT"; local $SIG{ALRM} = sub { die "timed-out\n" }; alarm $timeout; ## Lookup server's IP address. $ip_addr = inet_aton $host or die "unknown remote host: $host\n"; ## Create a socket and attach the filehandle to it. socket $self, AF_INET, SOCK_STREAM, 0 or die "problem creating socket: $!\n"; ## Open connection to server. connect $self, sockaddr_in($port, $ip_addr) or die "problem connecting to \"$host\", port $port: $!\n"; }; alarm 0;
|
|---|