[twsocket] Detect Internet connected or not?

Stephen Williams SWilliams@fm.optus.net.au
Mon, 19 Jun 2000 12:41:47 +1000

[ Regular readers beware...  my standard rant follows :) ]

There is no guaranteed method to tell if a machine is connected to the
"Internet" or not.  The "Internet" is just an extension of your local
network.  If you have just one machine, then your local network is that one

When your application is first run on the user's machine, ask them how they
connect to the Internet.  Do they have a preferred RAS connection that they
wish the application to use?  Do they connect via RAS and the application
should just use the default RAS settings?  Do they have a connection via
LAN, thereby avoiding the necessity for RAS to even be installed?  For an
example of how this should be done, use any Microsoft application that uses
the Internet, especially Outlook or IE.  Get as much information from the
user as you need so that your application can nicely deal with the task of
connecting to the Internet

Do not assume that everyone uses RAS to connect to the Internet.  Cable
modem users do not even need RAS installed because the cable system looks
like a LAN.  Users lucky enough to have routers and permanent connections
may not have RAS installed either.
But all these people still have Internet connectivity.

Each user may have a different Internet setup on their machine that your
application should respect and acknowledge.  What better way to find out
these settings than to ask the user what they are?  Your application will
then use this information to its advantage to provide a pleasant experience
for the end-user (ie. not dumping the user out of the esoteric video mode).

Steve 'Sly' Williams
IT Development
Cable & Wireless Optus Outsourcing Services
"What's so hard about pulling a sword out of a stone?  The real work's
already been done." -Lord Rust (Men At Arms -Discworld)

> My THttpCli app runs in the background of a graphics application that
> uses a very esoteric video mode.  Because of that, I would 
> like to know
> if the station is connected to the Internet or not.  Why?  
> Because if I
> execute a THttpCli method like Get, and the Internet is not connected,
> the RAS dialer program will be launched by Windows and cause a video
> mode switch, crashing the system.
> Is there a way for me to detect whether or not the user is 
> connected to
> the Internet, so I can prevent making any THttpCli GET method calls if
> it isn't?