in reply to Using IO::Socket
The canonical way to open an IO::Socket::INET instance to do what you want is,
Note that a socket which fails to connect does not return a false value.my $MySocket = new IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', # or whatever Timeout => 300); $MySocket->connected() or die "No connection to $host:$port";
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using IO::Socket
by pg (Canon) on Oct 12, 2004 at 16:16 UTC | |
by Zaxo (Archbishop) on Oct 12, 2004 at 17:06 UTC | |
|
Re^2: Using IO::Socket
by Earindil (Beadle) on Oct 12, 2004 at 15:53 UTC | |
by Zaxo (Archbishop) on Oct 12, 2004 at 16:22 UTC |