briandfoy / net-ssh-perl

Development on the Net::SSH::Perl module to support latest ciphers, key exchange mechanisms, etc.
Other
4 stars 1 forks source link

Timeout option for ssh command #32

Open briandfoy opened 1 year ago

briandfoy commented 1 year ago

This ticket was imported from rt.cpan.org 66433

Hi,

This is a but or not am not sure. However i would like to clarify.

Will a ssh command time out using Net::SSH::Perl.

I tried by passing Connection Timeout param but which is of of no use?

Could you please clarify?

Thanks, Sagar

briandfoy commented 1 year ago

From aparadis1@club-internet.fr


Hi,

I apply this patch, it's work

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 $!;

http://webcache.googleusercontent.com/search?q=cache:_I7_Ul90AKAJ:www.perlmonks.org/%3Fnode_id%3D566455+Net::SSH::Perl+Connect+Timeout&cd=1&hl=fr&ct=clnk&gl=fr&client=firefox-a

briandfoy commented 1 year ago

From aparadis1@club-internet.fr


link to perlmonks.org

http://www.perlmonks.org/?node_id=566455