Yeah, I did that. That's how I determined that the problem was with IO::Select::INET and not with anything else. My test code was:
#!/usr/bin/perl
use strict;
use IO::Select::INET;
my $sock = IO::Select::INET->new(
PeerAddr => '(host)', # where host is some host I knew
PeerPort => 'ftp(21)', # or http(80) or whatever
Proto => 'tcp'
);
print defined $sock ? 'Connected!' : $@, "\n";
exit 0;
And then again with Timeout => 0 and Timeout => 120. It was successful on all of them except for Timeout => 120, which it failed to connect (and not after 120 seconds).
Might I add to this that the reason IO::Socket::INET is giving for not creating the socket (as returned by $@) is 'IO::Socket::INET: Timeout'. Since I can connect when no Timeout is specified, I think I've at least narrowed it down to a problem within the module and not something en route causing a connection failure.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.