We have a little bit misunderstanding of retr() here ;-), and retr() absolutely does not provide you the kind of control you are looking for, over file transfer.

FTP involves two TCP connections, control connection and data connection. When you do things such like LIST etc., the control connection is used. When you do get() or retr(), the data connection is used.

For the control connection, it is always the FTP server listens for TCP connection, and your client connects to the server.

For the data connection, there are two modes:
  1. active mode (default). In this mode, the FTP client (your script) listens for TCP connection, and the FTP server side connects to you.
  2. passive mode. In this mode, the FTP server listens for TCP connection, and your client script connects to the server.
Internally, both get() and retr() resolve to the same FTP command "RETR", but before retr(), the two sides of FTP would negotiate and go to passive mode. In both mode, Net::FTP has full control of socket reading and writing, not your script.

There is no way Net::FTP can provide what allyc wants. To subclass Net::FTP sounds reasonable.

In reply to Re: Re: FTP Transfer Status by pg
in thread FTP Transfer Status by allyc

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.