in reply to Re^2: Net::SSH::Perl ConnectTimeout (ssh -o option)
in thread Net::SSH::Perl ConnectTimeout (ssh -o option)

This is a very late reply, but this has still not been implemented. I added the following to Perl.pm, right after the socket creation to give me a send/receive timeout of 10 seconds:

setsockopt($sock, SOL_SOCKET, SO_SNDTIMEO, pack('LL', 10, 0) ) or die $!;
setsockopt($sock, SOL_SOCKET, SO_RCVTIMEO, pack('LL', 10, 0) ) or die $!;

Hope that helps.
--mf
  • Comment on Re^3: Net::SSH::Perl ConnectTimeout (ssh -o option)

Replies are listed 'Best First'.
Re^4: Net::SSH::Perl ConnectTimeout (ssh -o option)
by Anonymous Monk on Apr 08, 2009 at 18:19 UTC
    This work-around almost solved my problem -- but my time_t was a 64-bit integer. I believe that pack("L!L!",...) is more portable in this case.
Re^4: Net::SSH::Perl ConnectTimeout (ssh -o option)
by cmv (Chaplain) on Aug 12, 2014 at 13:42 UTC
Re^4: Net::SSH::Perl ConnectTimeout (ssh -o option)
by Anonymous Monk on Mar 04, 2011 at 01:08 UTC
    Well this workaround is for timeout while creating SSH object or the timeout is applicable while executing a SSH command using that object. Will it die if there is no response from the command.
    Thanks