On 07/27/2018 10:48 AM, Sannyasin Brahmanathaswami via use-livecode wrote:

    if  (tResult < 400) then
       return true
    else
       return false
    end if

I'd be a little wary of that "< 400" result though. You may (or may not) want to follow redirects, and if you get a 418 you may want a cuppa <g>.

and due to the extra hops involved, I probably wouldn't try for "https://www.google.com";. DNS resolution will add tens to over a hundred milliseconds to a web command, so if you're going to go that route instead of opening a socket I'd go straight to "http://8.8.8.8:53";.

curl -v --trace-time 8.8.8.8:53
20 milliseconds

curl -v --trace-time www.google.com
50 milliseconds

But otherwise, yes... there is no way of checking for the internet without connecting to the internet.

--
 Mark Wieder
 [email protected]

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to