Also, if there's a risk of running inside a corporate network, you may
well have an authenticating proxy to go through - so merely opening a
connection to
google.com might not be enough, you might need to check
for 'http_proxy' environment variables, or platform-specific proxy
settings, or prompt the user - which defeats the purpose of the
automated check.
I suspect that in these cases you often *won't* be able to
automatically check for internet existence - so whatever your app
does, you should give the user some way to override it and say "yes, I
*do* have teh internets, but you need to access it via
http://proxy.evilcorp.com:666 with username 'fred' and password
'fredNov2009'*"
And, of course, your user may well have *partial* internet access -
they might have
google.com but have firewall rules blocking
gmail.com.
So I'm with Mark, check what they *need* to access. And allow them
to override your check!
- Korny (all too familiar with loading apps that fail, as they don't
work with proxies)
* of course any big corporate will 'secure' their network by forcing
monthly password changes, resulting in lots of passwords based on the
date. :)
--
Kornelis Sietsma korny at my surname dot com
kornys on twitter/fb/gtalk/gwave
www.sietsma.com/korny
"Every jumbled pile of person has a thinking part
that wonders what the part that isn't thinking
isn't thinking of"