ethrbunny has asked for the wisdom of the Perl Monks concerning the following question:

Im using this module to copy data in from 200+ hosts. Some of them time out randomly and I want to hit them again if its due to network speed (vs some other problem). Does anyone know what the default timeout value is for this module? Ive tried digging into the code (and the usual searches) but I must be too ignorant to find the value.

Replies are listed 'Best First'.
Re: net::sftp::foreign - default timeout?
by salva (Canon) on Nov 29, 2007 at 20:56 UTC
    you can set it on the constructor, for instance:
    my $sftp = Net::SFTP::Foreign->new('foo@bar.com', timeout => 300);
    Internally, it is stored on $sftp->{_timeout} and the default value is undef that means "do not time out".

    update: and $sftp->status becomes SSH2_FX_CONNECTION_LOST when a timeout causes some command to fail.