Aloha, Charles:

This connection speed feedback looks awesome. 

Does TSnet handle/monitor speed on all all the port 80/443 calls? 

set the url of widget "browser" to "https://www.himalayanacademy.com";  

I created a "horrible hack" to ping our server every few milliseconds ala 
Apple's own web page for this which returns a single word "success" but I'm 
hitting our own server instead.

local sConnectedStatus, sPingCount

on pingServer 
    if sConnectedStatus = true then
     put 0 into sPingCount
     exit pingServer
     else
     if sPingCount is > 10 then
     put "false" into sConnectedStatus
                         # disable some modules that need the internet or put 
up a message 
     put 0 into sPingCount
     exit pingServer
     else
     add 1 to sPingCount
     put url "http:www.himalayanacademy.com/ping.txt" to sConnectedStatus # 
contains one word: "true"
     send pingServer to me in 333 milliseconds
     end if     
     end if
end pingServer

function getConnectedStatus
  return sConnectedStatus
end getConnecdtedStatus

# where any given module can decide to try again … by issue pingServer at a 
later time.
-------------------------

the above actually works… there is probably a more sophisticated "best 
practices" way to do this… but my "baby XTalk" works… basically tries for 
almost 3 seconds + to access the internet before informing the user they are 
not connected

OTOH, I see Spotify will tell me "not connected" to the internet if I am on a 
very low 3G connection where the phone at "one bar" bandwidth" They obviouslydo 
not want users to have a bad experience trying to stream some music or podcast. 
I would be interesting to know their metric for when they consider the users 
disconnected.

So it would really be great, even for simple web calls, to inform users 
something like "Low bandwidth detected. Please be patient, items called from 
our server will take a bit more time."  or something "sweet" like that.. 
instead of just a loading icon that "takes forever"  (from the user point of 
view). In some case we need to be even more "dramatic" e.g. 

"This new module is a 22MB of download data, your bandwidth is low. Do you want 
to continue, or wait until you are on WIFI?" with "Cancel" or "Continue 
Download"


On 7/13/17, 12:52 AM, "use-livecode on behalf of Charles Warwick via 
use-livecode" <use-livecode-boun...@lists.runrev.com on behalf of 
use-livecode@lists.runrev.com> wrote:

     They allow you to set a minimum number of 
    bytes that must be sent/received within a specified time period for the 
    connection to be considered acceptable by tsNet. If the speed of 
    transfer falls below that amount, the connection will be timed out 
    returning control to your script.

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

Reply via email to