Thanks for the feedback, my initial thought was that it's a socket de-allocation problem as well, but I'm struggling to replicate the problem.

The platform is Windows XP Professional, running Activestates' ActivePerl 5.6.1 Build 635. Net::FTP version is 2.65 which seems to be the newest available for this build. The whole lot is compiled into a free standing Win32 Service using Perl Dev Kit PerlSvc v3

Playing around testing, I've tried the Reuseport and Reuseaddr options, but these throw back a "Macro Not implemented" result, which makes sense if you think about it as the RFC's state that only one service can run on any given port at any time, and forcing ReUsePort would cause IO::Socket to re-allocate the port immediately (not just when it's been freed). Incidentally, by creating multiple instances of IO::Socket::INET, I've discovered that the max sockets I am allowed to create is 255. However, in testing by performing quick recursive FTP connects/lists/transfers/disconnects to a local FTP server I can't replicate the problem despite performing over 12,000 iterations in the space of a few minutes!

This leads me either to the conclusion that something in my production code isn't correctly de-allocating the ports - or the WinXP API is occasionally allocating me a port that it then allocates to someone else consecutively!

Any ideas...?


In reply to Re: Net::FTP and Ports by Anonymous Monk
in thread Net::FTP and Ports by Anonymous Monk

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.