checking for Internet connection

Dave Cragg dcragg at lacscentre.co.uk
Sun Sep 29 05:54:01 EDT 2002


At 11:19 am -0700 28/9/02, Richard Gaskin wrote:
>How do you tell if an Internet connection is availble without typing up the
>user's machine?
>
>I had thought I might just set the socketTimeoutInterval to something like
>10 seconds and then just try to get a URL, but no matter what I set the
>socketTimeoutInterval to, when there's no Internet connection it takes about
>two minutes for urlLib to report an error.
>
>Any suggestions?

Richard, are you using the latest libUrl release (1.0.8b1)? It should 
handle this better, and timeout  in accordance with the 
socketTimeoutInterval when trying to open a socket.

However, I'm not sure if it will let you distinguish between a 
timeout as a result of a server error or a lack of an internet 
connection.

Cheers
Dave



More information about the metacard mailing list