Have a look in the dictionary at the tsNetSetTimeouts command. In particular, the last two parameters allow you to define a minimum transfer speed so that if a transfer falls below that speed, tsNet will abort the connection.
For example, if you issue the following command: tsNetSetTimeouts 30, 0, 300000, 60000, 30, 10000 Then tsNet will abort any connection that is transferring at a rate slower than 10000 bytes per 30 seconds. Cheers, Charles > On 16 Nov 2017, at 5:28 am, Ralph DiMola via use-livecode > <use-livecode@lists.runrev.com> wrote: > > Sannyasin, > > This is what I'm going to try to deal with the moving in/out of services > issues. I have not done this yet but will try in the next week or 2. > > 1) Talk to my web service and see if there is a reasonably fast connection. > 2) If so then use asynchronous TSNet to download data in the background with > a callback. > 3) Set a timer to keep checking the latency of the web service every second > or so until the data transfer is complete. > 4) Cancel the timer in the callback when TSNet completes. > 5) If at any time during the TSNet transfer the ping to the server is too > slow then cancel the transfer and notify the user the data connection is > either too slow or nonexistent at this time. > > That's all I got.... > > Ralph DiMola > IT Director > Evergreen Information Services > rdim...@evergreeninfo.net > > > -----Original Message----- > From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf > Of Sannyasin Brahmanathaswami via use-livecode > Sent: Wednesday, November 15, 2017 12:52 PM > To: How LiveCode > Cc: Sannyasin Brahmanathaswami > Subject: Testing Bandwidth with new TSNet Functions > > Someone suggested we could test bandwidth by getting the milliseconds before > calling a ping.txt file on our server (contains one word "true") and then > check the milliseconds after getting the result and we might use this to > determine if the bandwidth was sufficient for streaming content from the web > server. > > Some very, very big "million dollar" apps are surprisingly "brutal" about > this… Spotify, for example, even if I am on 3G and able to get a web page on > Safari in my iPhone 7… will simply throw up It's broken connection icon > (pretty ugly, whole screen display) and not even bother to "say anything" to > the user. > > FlipBoard, the "super access to all the publications in some large universe" > simply fails on startup if you are offline when you boot, they don't even > give the user the courtesy of a notification that they are off line. OK well > I take that back.. not at least they tell you to turn off airplane mode… but > if on super low 3G the app just becomes non-functional stopping cold on the > splash screen, again, not even bothering to tell the user anything. > > Our SivaSiva app has a mix of content resident in the app and content we call > dynamically, so I need a more robust/gracefulway to deal with users walking > from 4 bars strong LTE at the coffee shop to 1 blip 3G connection as they > walk down the street to the bus, and then back up with 5bars Wi-Fi at home or > office. > > Currently my ping-the-server method is to see if I can get the ping file, but > fetching a ping.txt with only 4 chars data, tends to work, even in low > bandwidth situations, this "fools" the app into thinking it has a connection, > but if they try to then look at a video in the browser widget from YouTube, > or load an image heavy page (our blog) or call some painting/artwork into an > image object… the browser widget just "goes white" -- (a bug IMHO), because > I can/do put up a loading gif on the card, but the browser widget takes over > and "hangs on blank" waiting for the GET connection go pull enough data to > start rendering and I have no way to tell the user their bandwidth is too > low. So this just make the app look like it failed or is "super slow." > > That's the back story: I know TS Net has some functions along these lines, > before I dive in from ground zero and flail around this issue, can anyone > share what they are using/doing to deal with variable bandwidth? What is > working for you and a few snippets would be greatly appreciated. > > Brahmanathaswami > www.himalayanacademy.com<http://www.himalayanacademy.com> Get the SivaSiva > App today (for iPhone and iPad) > https://itunes.apple.com/us/app/sivasiva/id1271260502?mt=8 > (Android Pending HQ's Solution to some Engineering Issues) > > > _______________________________________________ > 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 > > > _______________________________________________ > 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 _______________________________________________ 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