> >I am writing a small linux application and at some point i want to know if 
> >the user is hooked to the internet. how can i tell if the user has 
> >internet access at the moment ????
> 
>    You could check to see if a default route is present.

All my machines have a default route set, but there is only an
"internet" connection when the modem (in a remote firewall) is dialed up.

I think that the ping idea (or try a small tcp connection to a know good
host) is best, as even a DNS lookup (something I wondered about) could
give false positives with a caching nameserver.

--

      Tim Fletcher                  .~.
                                    /V\       L   I   N   U   X   
   [EMAIL PROTECTED]           // \\  >Don't fear the penguin<
 [EMAIL PROTECTED]      /(   )\
                                   ^^-^^

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam (For non-latiners: "I have a catapult. Give me all the
money, or I will fling an enormous rock at your head.")

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to