[Ssh-sftp-perl-users] Net::SSH2 connections not closing ?
Brought to you by:
dbrobins
From: Michael G. <mic...@bl...> - 2005-12-14 03:12:34
|
Hello, I am using latest version of Net:SSH2 from cpan and am having problems with ssh connections being stuck in a CLOSE_WAIT state. My perl app never shuts down, it is a continueous app the runs and calls the following function. I am calling channel close and disconnect but maybe I am missing something ? sub restrict { my $ssh2 = Net::SSH2->new; &contact_error("Unable to connect to server") unless $ssh2->connect($settings->get('filter.host')); &contact_error("Unable to authenticate") unless $ssh2->auth_password($settings->get('filter.user'),$settings->get('filter.pass')); my $chan = $ssh2->channel; $chan->exec('sudo ......') or $rtn=1; my $chan_rtn = $chan->exit_status; $chan->close; $ssh2->disconnect; &logging("BLOCKED IP @_"); return $rtn; } Thanks Michael |