Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: IO::Socket *always* making connection?

by saskaqueer (Friar)
on Feb 08, 2005 at 19:01 UTC ( [id://429188]=note: print w/replies, xml ) Need Help??


in reply to Re^2: IO::Socket *always* making connection?
in thread IO::Socket *always* making connection?

I don't see where your problem is. The following script works fine for me. My box has an smpt server listening on port 25, a pop3 server on port 110, and nothing on ports 9805 and 9806. The results are as expected.

#!/usr/bin/perl -w use strict; use IO::Socket; for my $port (25, 9805, 9806, 110) { my $skipA = 0; my $socketA = new IO::Socket::INET( PeerAddr => 'localhost', PeerPort => $port, Proto => 'tcp', ) or $skipA = 1; print "\$port: $port; \$skipA: $skipA\n"; } __END__ $port: 25; $skipA: 0 $port: 9805; $skipA: 1 $port: 9806; $skipA: 1 $port: 110; $skipA: 0

Replies are listed 'Best First'.
Re^4: IO::Socket *always* making connection?
by wolfger (Deacon) on Feb 08, 2005 at 19:12 UTC

    The problem comes not when there is nothing there (i.e. 9805/9806), but when there *is* something there, but it's busy. My program fails to retrieve any data, and also fails to say "sorry, couldn't connect, he's busy".


    --
    Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
    perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://429188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found