Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Net::SSH::Perl ConnectTimeout (ssh -o option)

by Anonymous Monk
on Sep 21, 2007 at 18:49 UTC ( [id://640422]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://640422]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found