Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Perl Script to Test Telnet Connectivity

by sectokia (Pilgrim)
on Nov 09, 2022 at 01:44 UTC ( [id://11148054]=note: print w/replies, xml ) Need Help??


in reply to Perl Script to Test Telnet Connectivity

If your intention is to simply determine if or not TCP opens on a port (i.e. you don't care about the protocol being transmitted on TCP), this can be done simply with TCP Ping (which just establishes TCP and then closes the connection).

Example:

use AnyEvent::Ping::TCP; my $t = tcp_ping '10.0.0.2', 1235; my $result = defined $t ? "OK" : "Failed"; print $result."\n";

Replies are listed 'Best First'.
Re^2: Perl Script to Test Telnet Connectivity
by redapplesonly (Sexton) on Nov 09, 2022 at 18:23 UTC

    This is a great chunk of code! Unfortunately, I couldn't install the module thanks to our company firewll, but I'm saving this to my notes nonetheless. Much appreciated!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found