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.

In reply to Re: Net::FTP Timeout by pg
in thread Net::FTP Timeout by cknowlton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.