in reply to Net::SSH2 just hangs up without any output

Do you know where it's hanging ? (You could insert some print "Got to here\n"; lines to determine where it's hanging.) If it's hanging after $chan2->shell(); try inserting $chan2->blocking(0);.

I ran your script on a linux box (localhost) and here's the output:
Username/Password is correct libssh2_channel_open_ex(ss->session, pv_channel_type, len_channel_type +, window_size, packet_size, ((void *)0) , 0 ) -> 0x82cf7c0 Net::SSH2::poll: timeout = 250, array[1] - [0] = channel - [0] events 1 - libssh2_poll returned 1 - [0] revents 1 Net::SSH2::Channel::read(size = 1, ext = 0) - read 1 bytes - read 1 total LINE : Net::SSH2::poll: timeout = 250, array[1] - [0] = channel - [0] events 1 - libssh2_poll returned 0 - [0] revents 0 Net::SSH2::Channel::DESTROY Net::SSH2::DESTROY object 0x8131de0
It didn't hang for me ... but then I suspect that's not the output you were looking for.

Update:With debugging turned off the output reduces to:
Username/Password is correct LINE :
(On the same machine, 'hostname -a' returns nothing ... so the output looks about right to me.)

It would be a good idea to run the Net::SSH2 test suite against the server. (If you've already done that, did all tests pass ?)

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Net::SSH2 just hangs up without any output
by Anonymous Monk on Aug 28, 2007 at 14:57 UTC

    Hi Rob,

    Thanks a lot Rob you were exactly right the problem was with $chan2->blocking(0); being not set. Now i get my outputs right.

    Thankyou,
    pradeep