in reply to SSH connection refusal kills CGI
I'm afraid that if you read the source, you'll see:
connect($sock, sockaddr_in($rport, $raddr)) or die "Can't connect to $ssh->{host}, port $rport: $!";
So the author has decided this is a fatal error. The traditional solution is to wrap the request in an eval to catch the exception:
eval { my $ssh = Net::SSH::Perl->new($tsip) } if ( $@ ) { # Error } else { # Success }
P.S. use strict; use warnings;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SSH connection refusal kills CGI
by Dranzaz (Sexton) on Nov 25, 2005 at 15:53 UTC |