Checking for internet connection

Shari shari at gypsyware.com
Thu Feb 10 10:03:16 EST 2005


I've been using the following to check for internet connection:

if hostNameToAddress(www.gypsyware.com) is empty then
# not connected to the internet

I've just discovered a flaw in it.  I'm not connected to the internet 
and it is not coming up empty.  What's more, it is taking me to the 
web page!  Apparently if the page is cached, this will produce a 
false positive, and pull up the cached page.  That's bad.  Not 
desireable.  As one of the menu items is supposed to go to my website 
and check for newer versions of the software.

I didn't want a high falutin' piece of code.  I just wanted to know 
if someone was connected before attempting to take them somewhere. 
This was so simple, cross platform, short and sweet.  But dang those 
cached pages!

Any idears?

Shari
-- 
Mac and Windows shareware games
http://www.gypsyware.com


More information about the metacard mailing list