Internet checking?

Bob Sneidar bobsneidar at iotecdigital.com
Thu Mar 1 00:40:03 CET 2018


Here is a script I use. A lot of this stuff won't make sense because it is part of my interface with sqlYoga, but the core is a repeat loop where I open a socket to the server, then check if the socket is among the lines of the openSockets. If it is I exit the repeat loop and close the socket, then return true, otherwise I wait 1 second, then try again. After 5 failed attempts I alert the user and offer to try again (2 repeat loops) until t he user cancels in which case I exit to top. 

This has worked fairly well for me. On the flip side I religiously ensure I close the database connection after I am done with it, but of course you are using it to access a file. Same principle though. 

Bob S


> On Feb 28, 2018, at 15:20 , Graham Samuel via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> [This message was identified as a phishing scam. Learn about phishing at http://aka.ms/LearnAboutPhishing]
> 
> 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?
> 
> TIA
> 
> Graham
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list