Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quickest way to test for a connection
Message
From
10/02/2001 18:15:27
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00474709
Message ID:
00474770
Views:
17
>I'm using one of the Mabry controls for some FTP stuff, but before firing the Connect method for that control, is there someway I can quickly test for an active internet connection? (The control has a timeout setting on it, etc. but it acts a bit squirrelly when there is no connection present.)
>
>ALL of the end users are connected to a T1 or ISDN (at the least) but I assume there will be times when their connection is down. Is there an API call or something else I can use to check for the connection? (Especially something that will give me a quick T or F, regardless of that user's specific connection type.)
>
>Thanks in advance,

Unfortunately, there's no easy way to do this, all we can do is check for the accessibility of a known reliable resource (a ping, for example). There are Windows API functions that are supposed to tell you if you've got a connection, but they're not reliable.

If you think about it, especially on a LAN, there's no solid definition of a live internet connection- your default gateway could be alive, but the pipe down, or the pipe is up, but the DNS server down, or any other number of combinations that are somewhere between 'connected' and 'not connected'. The only dependable way to check is to test your resource.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform