in reply to My Perl/Expect script aborts when sftp connection stalls at remote destination

You might want to look at Net::ssh2 timeout and look at syphilis's reply about setting the poll(0). Net::SSH2 does sftp. Possibly, you could find how to set the poll() from your script.

Upon looking thru the Net::SSH2 docs for clues, it seems a timeout value for the connection gets set

connect ( handle | host [, port [, Timeout => secs ]] )
Since sftp uses ssh2 libs, there probably is some arcane way of you setting the ssh2 options from sftp. Or do like the rest of the modern world, and move up to Net::SSH2.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku
  • Comment on Re: My Perl/Expect script aborts when sftp connection stalls at remote destination
  • Download Code

Replies are listed 'Best First'.
Re^2: My Perl/Expect script aborts when sftp connection stalls at remote destination
by salva (Canon) on Feb 25, 2010 at 14:58 UTC
    Net::SSH2 does sftp

    Only in a rather limited way!

    Net::SSH2 implements the low level methods defined in the SFTP draft but lacks the most useful methods you could expect from an SFTP client (i.e. get or put). Writting these methods yourself from the protocol primitives in an efficient manner is very hard.