Socket timeout not working with libUrl

Alex Tweedly alex at
Fri Jan 28 08:40:07 EST 2005

Frank Leahy wrote:

> Hi,
> My product pings the Web Photos Pro website to look for new versions.  
> This works great when the computer the product's running on is 
> connected to the internet, but it hangs for 60 seconds when there's no 
> net connection.
> My code looks like this:
>   set the socketTimeoutInterval to 5000
>   put URL (getPhotoAlbumUrl() & "downloads/version_info.php") into 
> newVersion
> Is there any way I can force a timeout after 5 seconds?  Should I be 
> using a non-blocking URL request?  Should I be attempting to open a 
> socket directly to do an initial "am I connected to the internet?" 
> request, before making the URL request?

it may depend on "how" the computer has no internet connection. Normally 
if there is no connection at all, it will fail immediately. I ran into a 
problem (with Revonline) that if the computer has a working connection 
to a router or other connecting machine, then it can fail.

See Bugzilla 2117 for some more info and a hint of a possible workaround 
from Mark.

I think you could also use a non-blocking URL request, if that was easier.

-- Alex.

No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.6 - Release Date: 27/01/2005

More information about the Use-livecode mailing list