Link to home
Start Free TrialLog in
Avatar of kdw
kdw

asked on

best method for detecting live net connection

I have an app that sits in the system tray and automatically downloads data with http periodically.

The problem is that of course sometimes modem users aren't logged on to the net.  In this case, with some users (including some AOL Users), this http activity will try to force the users to log in (pop up either dial-up net or AOL login screen).  So, what I need is the best method possible to see if there is a net connection without actually having an impact on the system.

ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PeterLarsen
PeterLarsen

Listening..
Avatar of kdw

ASKER

inthe, here is a question.  Using the ping method, do you have to use an IP address?  I've got a friend tell me that using a domain name with the ping has the same problem of starting the net connection when it does the hostname lookup.

If so, is there anything such as an IP address that will almost always be alive?
if you get f.piettes ping component look at the demo "pingtst" ,it converts a web address "www.borland.com" to a ip address then trys to ping it.
if it comes back DnsLookupDone and has erro <> 0 then the host was not resolved
(you know here that you are most likely not online)
you should ping about at least  3-4 different address like www.amazon.com,www.borland.com,www.microsoft.com etc..
becuase sometimes the pings timeout will activate before the ping is made it to the ip address.if you use 3-4 at least 1 will get through and if none get through you can safely assume your not online whearas only one ping needs to make it and you know your online for sure..
therefore you dont need a ip addess just giving it a web address should be sufficent and i have no problems with it trying to logon if im not logged on already ..
note i also use aol and no problems ..
 
you dont have to use ping but it pronbably the safest way to be sure ..
did you try the http://members.xoom.com/kirez/download.htm
one ?
it works for me also ..
Avatar of kdw

ASKER

Thanks for the help.  Went for the Ping method and looks like it is working well so far.