I should also supply some details. I'm restricted as to my environment. I am using Perl 5.005, and IO::Socket ver 1.1603. These, unfortunately, cannot be changed.

Thanks to the comments and suggestions already supplied. However, my problem still exists. On my Windows server, "ECONNREFUSED" doesn't appear to work as you might expect (not at all?). Also, the connection I'm trying to make is going out over a WAN link, (I don't know if this matters or not.)

As for the suggestion to use the Timeout and then use the "accept" method, is this not testing a Server port on my own server? What I need to do is use a Client Connection to test a Server over the WAN.

Below is the code I used. I can fill in a value for Timeout all I want, but it appears to be ignored.

use IO::Socket::INET; $server = '192.168.27.236'; $p = new IO::Socket::INET ( PeerAddr => $server, PeerPort => 135, Proto => "tcp", Timeout => 5 ); if ($p) { print "\tPINGed $server at ".scalar(localtime).".\n"; } else { print "\tFailed to PING $server at ".scalar(localtime).".\n"; }
What I get is, (notice the amount of time until "failure"):
Started at Tue Nov 18 15:03:02 2003. Trying to RPCPing 192.168.27.236 at Tue Nov 18 15:03:02 2003. Failed to PING 192.168.27.236 at Tue Nov 18 15:03:25 2003. Finished at Tue Nov 18 15:03:25 2003.
A successful response is almost immediate.

Again, Thanks!


In reply to Re: Seeking IO::Socket Advice by DTOakey
in thread Seeking IO::Socket Advice by DTOakey

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.