Internet checking?

J. Landman Gay jacque at hyperactivesw.com
Thu Mar 1 06:47:40 CET 2018


On 2/28/18 5:20 PM, Graham Samuel via use-livecode wrote:
> I know this is a golden oldie, but I can’t find a reference… I have a script that wants to check a file on a server, and basically to do nothing if the program is offline.
> 
> Remind me, is there an easy way to tell from within an LC standalone if the internet is not accessible? I don’t want my program to hang. I understand the URLStatus will eventually tell me if access did not occur, but I don’t understand how to limit the waiting time to something reasonable. I notice that some browsers can actually display a message saying something like “you are not connected to the internet” - how do they do that?

I haven't actually played with it, but it looks like tsNetSetTimeouts 
might work if you set the pConnectTimeoutMS (the third param) to 
something shorter than the default. Then when you try to retrieve your 
file when there is no connection, you should get an error from tsNet.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list