I was using Net::FTP and ran into a problem. None of the FTP sites I was trying to connect to would return a connection. Net::FTP (which subclasses IO::Socket) was returning a timeout (despite the fact that I could get to any and all FTP sites very quickly). Net::FTP defaults to a Timeout of 120 on those connections, and it was returning almost immediately, it seemed.

I tried passing in an explicity Timeout of 0 and sure enough, things connected as expected. Apparently, this is related to IO::Socket::INET as I could reproduce the behavior there.

Did something change in this module. Apparently, if I have any Timeout value specified, the socket times out, but if I explicitly pass in a 0 value or don't pass in a Timeout value at all, things work as they should. Is Timeout a boolean (the IO::Socket::INET manpage just says 'Timeout value for various operations', which I assume would be seconds (as do almost every other module that I use).

For some more information, this a fresh build of perl 5.6.0 on a RedHat 7.0-based i586 Linux install (kernel 2.2.18). Compilation is done using gcc 2.96 20000731.


In reply to IO::Socket::INET Timeout Issue by Hrunting

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.