libUrl tsNet and socketTimeoutInterval

Sannyasin Brahmanathaswami brahma at hindu.org
Tue Dec 5 14:19:12 EST 2017


@ Charles (and anyone else)

using

tsNetSetTimeouts 30, 0, 300000, 60000, 30, 1000 

I need to implement this in our app… "minimum amount of data…" is obviously different from "no connection whatsoever"  

Your example assumes that for this use case, 30 seconds is acceptable. That may well be for a DropBox app where "downloading stuff" is a known "may take a long time" context. But clearly that's way too long for many contexts. Mobile users have high expectations on responsiveness. Can anyone give us some standard numbers for a Bytes/Seconds setting(s)  for a reasonable time out period for e.g. streaming audio OR an HTML page? 

I realize this question is highly context dependent. If one is calling a plain text static html page with one small image, the total data is very little. even on a slow connection, it might still load in a "some" (reasonable wait) seconds" … but then if one is about to stream an audio file (mp3) from the server which could be e.g. 30 minutes long in duration, the player will wait and wait and wait  perhaps get started, then stall ….since we set up Cloud Flare I'm seeing some big improvements on this front. no more outgoing traffic/CPU overload notifications from our Linode server…since CloudFlare is now serving all cached files from their CDN… Bu we still need to deal with local latencies as the user moves from her Home to his car to Starbucks + WiFi and then a walk down the street into the office (back up on hi-strength wifi

Spotify is quite "brutal" in it's approach… with 2 bars on a 3G connection… I can still go to Safari in my iPhone and fetch a small html page, but Spotify throws up it's ugly disconnected icon with no information on a black screen.  Flipboard (delivers articles from publications… less bandwidth needed that Spotify for audio) used to just not open at all… now it will give some message about "connect to the internet"  -- confusing to the user when he can still connect in Safari

So if that's the way the Big Boys with the Million Dollar Apps do it. I wonder if I am just dreaming that us "little LC devs" can do a better job.

With TSNet (thanks for making this fully available now in Indy!)  we could fine tune this along the way. Theoretically one could dymanically reset the time out ahead of different classes of content

1) skinny text only pages
2) image heavy pages
3) streaming audio/video.

So I guess this boils down to one question: 

If you are streaming audio or video.. .what would be the reasonable bytes per second you would want to "see" as current bandwidth before telling the users that their connection is too slow.

All thoughts on this welcome, as I go off to the net to find bandwidth standards… But maybe someone here already knows the answers/has experience? And of course, I can just build it and test (which we will do anyway)

Brahmanathaswami
 

On 11/22/17, 6:16 PM, "use-livecode on behalf of Charles Warwick via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    Have a look at the following bug report which is about a similar issue:
    
    http://quality.livecode.com/show_bug.cgi?id=20627
    
    Effectively the last two parameters to that command allow you to set a minimum amount of data that must be transferred across a connection within a specified period of time to consider a connection still active.
    
    Having said that, when tsNet is disabled, libUrl should continue to pay attention to the socketTimeoutInterval property.
    
    I have just done quick test on LC8.2.0dp2 and if I set the socketTimeoutInterval before making a “put URL xxx” call to a script that deliberately doesn’t respond in time, the request times out after the time specified by the socketTimeoutInterval call and returns a result of “socket timeout”.



More information about the use-livecode mailing list