Ping

Tim Lavoie tim.lavoie at mts.net
Fri Nov 17 10:31:19 EST 2000


Matthew Dixon Cowles wrote:

>If I were doing what I imagine you're doing and I only needed
>reachability info (and not round-trip time information), I'd follow up
>Tim Lavoie's suggestion of making a socket connection attempt to the
>machine. If a socket connection suceeds or results in a connection
>refused error, the machine is likely to be up. If the connection
>attempt times out, the machine is likely dead. Here's a trivial
>example:

Just one note here... A "connection refused" error might have been refused
by an intermediate device such as a firewall, not the intended destination
box.

Also, SOCK_RAW is probably still needed if you want something like traceroute,
so that you get hop info.

-- 
Man is the best computer we can put aboard a spacecraft ... and the
only one that can be mass produced with unskilled labor.
                -- Wernher von Braun



More information about the Python-list mailing list