Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: net ping question

by gellyfish (Monsignor)
on Apr 15, 2005 at 09:48 UTC ( [id://448114]=note: print w/replies, xml ) Need Help??


in reply to net ping question

You probably don't want to use Net::Ping to this as this will use the TCP echo service and all you are doing is changing the port to which it tries to connect to this service. I would suggest if you just want to check whether you have a particular port open on a particular machine you do something like:

use IO::Socket; + my $sock = IO::Socket::INET->new(PeerAddr => 'localhost', PeerPort => 'http(80)', Proto => 'tcp'); + + print $sock ? "alive" : "not alive";

/J\

Replies are listed 'Best First'.
Re^2: net ping question
by perlknight (Pilgrim) on Apr 15, 2005 at 15:01 UTC
    Thanks. Will try it out and see if it works.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-16 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found