Granted, according to the docs, my snippet will say $host is alive
if it accepts connections on port 80. This might or might not mean that a webserver is running, just that something is listening there, or - more precisely - that a successful connection was made (three way handshake completed).
robartes reads some docs...
Ah, that's what the syn 'protocol' is. The Perl 5.8.0 version of Net::Ping (whose docs I consulted) does not have this yet. If I understand correctly, for just testing one host, using syn is over the top, tcp does all of that in one call. If you are pinging various hosts, using a bunch of syn's and then using the ack method to listen for the returning ACK packets (if any) will be the way to go, as stated in the docs.
robartes reads some more docs...
Double ah. So the darn thing answers true if it gets a RST as well. xmath, you are fully correct in your reply to my comment.
Thanks for the heads up, xmath.
Update:: the confusion seems to stem from using different version of Net::Ping. My post assumes the version bundled with Perl 5.8.0, xmath is working off of version 2.28 of Net::Ping, which indeed shows the behaviour he comments on.
CU
Robartes-
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.