Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i have installed successfuly Net-SSH-Perl [1.29] on my xp proffesional ,when i am running this simple code :
use Net::SSH::Perl;
$host="127.0.0.1";
my $ssh = Net::SSH::Perl->new($host);i get an error code :
Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib/Net/SSH/P
erl.pm line 212, <GEN0> line 1.i have tried it on a second computer and got the same results.
does anybody know about this problem?
please advise.

I don't think it will allow you to ssh to yourself, but I've never tried it. If it will, it would be better to use your actual ip address or hostname, not the loopback address.
It would be much better to test your script by ssh'ing to another system.

i have tried to ssh to another diffrent computer with the same syntax
$host="10.10.15.4";
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
but i got the same error :
Can't set socket non-blocking: Bad file descriptor at C:/Perl/lib/Net/SSH/Perl.p
m line 212, <GEN0> line 1.i know its ridiculos to ask but
did somebody ever tried it on an windows machine?

After checking on aspn.activestate.com, it appears that this is a known issue. The recommended solution is to use Net::SSH::W32Perl instead, however I received the same error using that module as well. I'm not sure what else to suggest.

I had the same problem.
Editing the file C:/Perl/lib/Net/SSH/Perl.pm and commenting out lines 212 and 213 as follows let it run for me.
$ssh->{session}{sock} = $sock;
$ssh->_exchange_identification;# defined($sock->blocking(0))
# or die "Can't set socket non-blocking: $!";$ssh->debug("Connection established.");
}I don't know how this affects the actual execution or whether this is a really bad fix, but my script seems to run okay.

![]() |
C++ Help - rdbuf()
|
Highlighting a cell in a ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |