troubleshooting Question

Detecting available internet connection in VB.NET

Avatar of NCSO
NCSO asked on
Visual Basic.NET
38 Comments1 Solution644 ViewsLast Modified:
Hi,

We have an application that connects to our IIS server on the DMZ through a GPRS/EDGE/G3 connection and because we're in a somewhat rural part of Florida we do not always have a connection to the Internet and I was wondering if there's a cleaver way of detecting it that doesn't take forever.

The IsNetworkAvailable is good for when you disconnect the connection yourself and works great that way, but it doesn't detect the signal disappearing.  (MyApplication_NetworkAvailabilityChanged never fires.)

I am currently using Computer.Network.DownloadFile to check if I have a connection by downloading a file from the IIS server, but the ConnectionTimeout parameter does not seem to work as I expected and if the connection isn't there, it takes 10-15 seconds to find out.

I cannot believe I would be the only one to have this problem.

Basically what I want is to know whether or not I have a connection.   It just shouldn't be that hard.

Yes I could just wait for the timeout on my transaction and figure it out that way, but the IIS timeout is 30 seconds and that's a long time to wait.

Thanks a bunch
~j
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 38 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 38 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros