in reply to Net::FTP Timeout

The timeout value you set is 'passed' to IO::Socket::INET (Net::FTP @ISA IO::Socket::INET, if you open up the package, you will realize this), and will be applied to operations against that socket.

Not in doc for Net::Ftp, but in doc for IO::Socket::INET, you can find the detailed explanation on timeout.

Update:Carlos, I looked at those testings you mentioned, in your reply to Zapawork. Yes, those test cases are valid. Let me explain:
  1. First of all the timeout value is absolutely not only for socket creation, or accept, but for 'various' operations as stated in doc for IO::Socket::INET, so it is also for things like read/write/send/recv, which are behind your get/put from a Net::FTP view.
  2. The purpose of timeout is to leave space for retry and recovery. You said that you set timeout to 120 seconds, you pulled out the cable in middle of get operation, and the get operation timed out after 120 seconds from the moment you pulled out the cable. That's exactly what you should expect. If it is counted from the beginning of the operation, it does not make any sense. For example, you set timeout to 120 seconds, you start getting a huge file, at the 130th second, you pull out the cable, if timeout is counted from the beginning of the get operation, then it will timeout right away, there is no space for retry or whatsoever. this is not what you want, right?
  3. You also did another test, in which you pluged the cable back before timeout, and the transfer is successful. I believe you already know the reason. Yes, you are right, that's the space for retry/recovery, and the recovery was successful before the timeout.

Replies are listed 'Best First'.
Re: Re: Net::FTP Timeout
by cknowlton (Acolyte) on Dec 17, 2002 at 14:19 UTC

    Thanks for the update, I feel a serene sense of enlightenment! =')

    I'm also going to check out that 'rsync' utility that others have pointed out. (thanks guys!)


    -Carlos