in reply to Seeking IO::Socket Advice
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.
What I get is, (notice the amount of time until "failure"):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"; }
A successful response is almost immediate.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.
Again, Thanks!
|
|---|