Checking if internet is connected using tsNet?
ahsoftware at sonic.net
Sat Jul 28 00:44:17 CEST 2018
On 07/27/2018 10:48 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> if (tResult < 400) then
> return true
> 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://184.108.40.206:53".
curl -v --trace-time 220.127.116.11:53
curl -v --trace-time www.google.com
But otherwise, yes... there is no way of checking for the internet
without connecting to the internet.
ahsoftware at gmail.com
More information about the use-livecode