Hi,
Are these two snippets same or different in any aspect?
I understand the first one is executed from shell of the base server and the second one is perl script. I am trying to understand is IO
ocket::INET equivalent of telnet command.
(1)
# telnet targetserver 20014
"Is the connection successful?”
(2)
#perl
my $sock = IO:
ocket::INET->new(
PeerAddr => targetserver,
PeerPort => 20014,
Proto => 'tcp',
Type => SOCK_STREAM,
Timeout => 10);
if ($sock) {
close($sock);
print "PASS\n";
} else {
print "FAIL\n";
}
Thanks