Re: libUrl tsNet and socketTimeoutInterval

2017-12-12 Thread Charles Warwick via use-livecode
-
> 
>The Get_Path function below is a function returns paths that are 
> transparent between IDE and mobile. (Richard G. I got sucked into the 
> returning the trailing slash before I realized it was not the best way to do 
> it). I hacked out this code so there could be an error but the basic idea is 
> here.
> 
>I call this first handler(StartBackgroundImageDownload) 12 time 
> quickly and all the downloads work. The app is fully functional while the 
> downloads are in progress. I use the filename as the pID. This makes things 
> easy when the download completes. I have not tested timeouts yet. That's the 
> next step, handling the in/out of network access/slow network speed. 
> Standby
>This is the guts of the asysnc file downloading:
>
> ---
>command StartBackgroundImageDownload pImageName
>   local pHeaders, tStatus
> 
>   put tsNetGetFile(pImageName, Get_Path("Updates"),  \
> "https://xxx.com/someFolder/"; \
> urlencode(pImageName), pHeaders, 
> "DownLoadBackgroundImageComplete") into  tStatus-- start download
>   if tStatus is not empty then
> answer tStatus
> end if
> 
>end StartBackgroundImageDownload
> 
>on DownLoadBackgroundImageComplete pID, pResult, pBytes, pCurlCode
> 
>   local tData, tHeaders
> 
>   --answer 
> "File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
> 
> 
>   if pCurlCode is not 0 then
> 
> answer tsNetRetrError(pID)
>   else
>  if pResult = 404 then
> answer "File'"&&&"not 
> found==>"&&"Result==>"
> delete file Get_Path("Updates") -- delete file with 404 
> error in it
>  else
> --answer 
> "File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
> if pBytes > 2000 then -- GOOD DOWNLOAD
>rename file (Get_Path("Updates")) to 
> (Get_Path("BackgroundImages")) -- file download complete
> 
>   --answer "File'"&&&"has been downloaded. 
> Result==>"
> 
> else
>   answer "File'"&&&"has been downloaded but is too 
> small==>"&&"Result==>" -- this was before I had the 404 check
>   delete file Get_Path("Updates")
> end if
>  end if
>   end if
> 
>   tsNetCloseConn pID
> 
> 
>end DownLoadBackgroundImageComplete
> 
>-
> 
>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: Friday, December 08, 2017 2:21 PM
>To: How to use LiveCode
>Cc: Sannyasin Brahmanathaswami
>Subject: Re: libUrl tsNet and socketTimeoutInterval
> 
>Awesome Ralph:
> 
>Looks like we need to crowd fund Charles for documentation (smile)
> 
>You are about 3 days ahead of me… can you post some code snippets  of 
> your methods?
> 
> 
> 
>On 12/7/17, 1:54 PM, "use-livecode on behalf of Ralph DiMola via 
> use-livecode" <use-livecode-boun...@lists.runrev.com on behalf of 
> use-livecode@lists.runrev.com> wrote:
> 
>Ok, I just got async tsNet working in IDE and Android(Testing iOS 
> later). I works great! Hat tip to all the contributors. One question and one 
> Observation:
>1) How do you query the current tsNet timeout settings? I have 
> quite a few places where I save the socketTimeoutInterval, set it to a new 
> value, do something and then set it back to the saved timeout. I don't see a 
> way to query this in the dictionary.
>2) I seems the you don't need to do a "tsNetInit" in the IDE. In 
> the IDE one gets "tsneterr: Already initialized". On Android this error does 
> not occur.
> 
>Ralph DiMola
>IT Director
>Evergreen Information Services
>rdim...@evergreeninfo.net
> 
> 
> 
>___
>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


___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-10 Thread Sannyasin Brahmanathaswami via use-livecode
sysnc file downloading:

---
command StartBackgroundImageDownload pImageName
   local pHeaders, tStatus
   
   put tsNetGetFile(pImageName, Get_Path("Updates"),  \
 "https://xxx.com/someFolder/"; \
 urlencode(pImageName), pHeaders, 
"DownLoadBackgroundImageComplete") into  tStatus-- start download
   if tStatus is not empty then
 answer tStatus
 end if
   
end StartBackgroundImageDownload

on DownLoadBackgroundImageComplete pID, pResult, pBytes, pCurlCode
   
   local tData, tHeaders
   
   --answer 
"File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
   
   
   if pCurlCode is not 0 then
  
 answer tsNetRetrError(pID)
   else
  if pResult = 404 then
 answer "File'"&&&"not found==>"&&"Result==>"
 delete file Get_Path("Updates") -- delete file with 404 
error in it
  else
 --answer 
"File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
 if pBytes > 2000 then -- GOOD DOWNLOAD
rename file (Get_Path("Updates")) to 
(Get_Path("BackgroundImages")) -- file download complete

   --answer "File'"&&&"has been downloaded. 
Result==>"
   
 else
   answer "File'"&&&"has been downloaded but is too 
small==>"&&"Result==>" -- this was before I had the 404 check
   delete file Get_Path("Updates")
 end if
  end if
   end if
   
   tsNetCloseConn pID
   
   
end DownLoadBackgroundImageComplete
    
    -

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: Friday, December 08, 2017 2:21 PM
To: How to use LiveCode
Cc: Sannyasin Brahmanathaswami
Subject: Re: libUrl tsNet and socketTimeoutInterval

Awesome Ralph:

Looks like we need to crowd fund Charles for documentation (smile)

You are about 3 days ahead of me… can you post some code snippets  of 
your methods?

 

On 12/7/17, 1:54 PM, "use-livecode on behalf of Ralph DiMola via 
use-livecode" <use-livecode-boun...@lists.runrev.com on behalf of 
use-livecode@lists.runrev.com> wrote:

Ok, I just got async tsNet working in IDE and Android(Testing iOS 
later). I works great! Hat tip to all the contributors. One question and one 
Observation:
1) How do you query the current tsNet timeout settings? I have 
quite a few places where I save the socketTimeoutInterval, set it to a new 
value, do something and then set it back to the saved timeout. I don't see a 
way to query this in the dictionary.
2) I seems the you don't need to do a "tsNetInit" in the IDE. In 
the IDE one gets "tsneterr: Already initialized". On Android this error does 
not occur.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net



___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Sannyasin Brahmanathaswami via use-livecode
he 404 check
   delete file Get_Path("Updates")
 end if
  end if
   end if
   
   tsNetCloseConn pID
   
   
end DownLoadBackgroundImageComplete

-------------

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: Friday, December 08, 2017 2:21 PM
To: How to use LiveCode
Cc: Sannyasin Brahmanathaswami
Subject: Re: libUrl tsNet and socketTimeoutInterval

Awesome Ralph:

Looks like we need to crowd fund Charles for documentation (smile)

You are about 3 days ahead of me… can you post some code snippets  of your 
methods?

 

On 12/7/17, 1:54 PM, "use-livecode on behalf of Ralph DiMola via 
use-livecode" <use-livecode-boun...@lists.runrev.com on behalf of 
use-livecode@lists.runrev.com> wrote:

Ok, I just got async tsNet working in IDE and Android(Testing iOS 
later). I works great! Hat tip to all the contributors. One question and one 
Observation:
1) How do you query the current tsNet timeout settings? I have quite a 
few places where I save the socketTimeoutInterval, set it to a new value, do 
something and then set it back to the saved timeout. I don't see a way to query 
this in the dictionary.
2) I seems the you don't need to do a "tsNetInit" in the IDE. In the 
IDE one gets "tsneterr: Already initialized". On Android this error does not 
occur.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net



___
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

RE: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Ralph DiMola via use-livecode
BR,

I async also works in iOS just fine and dandy. In My app I am getting the 
background images for cards while the user first logs in. Async allows the 
images to be downloaded in the background. This allows me to change images 
without releasing a new app without hanging the app up when I used blocking 
libURL. The implementation was so easy it was frightening. I also have 6 of 
these queued up and running at the same time!

First is a utility(NetworkType) to check the type of networking and a tsNet 
initialization handler (EISinitTSnet):


function GetNetworkType
   local tLibUrlDriver
   
   try
  put the behavior of stack"revLibUrl"into tLibUrlDriver
   end try
   if tLibUrlDriver is empty then
  return "Sockets"
   else
  return "tsNet"
   end if
   
end GetNetworkType

command NetworkType
   if GetNetworkType() = "Sockets" then
  answer"tsNet is disabled"
   else
  answer "tsNet in use"&"Version==>"& tsNetVersion()
   end if
end NetworkType

command EISinitTSnet
   local tResult
   
   try
  tsNetInit
  put the result into tResult
  if tResult is not empty then
 if tResult = "tsneterr: Already initialised" then
 else
answer tResult
 end if
  else
 tsNetSetTimeouts 60, 5000, 5000, 5000, 5, 1
  end if
   catch someerror
  if IsInternalUser(true) then answer TranslateError(someerror)
   end try
end EISinitTSnet



The Get_Path function below is a function returns paths that are transparent 
between IDE and mobile. (Richard G. I got sucked into the returning the 
trailing slash before I realized it was not the best way to do it). I hacked 
out this code so there could be an error but the basic idea is here.

I call this first handler(StartBackgroundImageDownload) 12 time quickly and all 
the downloads work. The app is fully functional while the downloads are in 
progress. I use the filename as the pID. This makes things easy when the 
download completes. I have not tested timeouts yet. That's the next step, 
handling the in/out of network access/slow network speed. Standby
This is the guts of the asysnc file downloading:
---
command StartBackgroundImageDownload pImageName
   local pHeaders, tStatus
   
   put tsNetGetFile(pImageName, Get_Path("Updates"),  \
 "https://xxx.com/someFolder/"; \
 urlencode(pImageName), pHeaders, "DownLoadBackgroundImageComplete") 
into  tStatus-- start download
   if tStatus is not empty then
 answer tStatus
 end if
   
end StartBackgroundImageDownload

on DownLoadBackgroundImageComplete pID, pResult, pBytes, pCurlCode
   
   local tData, tHeaders
   
   --answer 
"File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
   
   
   if pCurlCode is not 0 then
  
 answer tsNetRetrError(pID)
   else
  if pResult = 404 then
 answer "File'"&&&"not found==>"&&"Result==>"
 delete file Get_Path("Updates") -- delete file with 404 error in it
  else
 --answer 
"File==>"&"Bytes==>"&"Result==>"&"CurlCode==>"
 if pBytes > 2000 then -- GOOD DOWNLOAD
rename file (Get_Path("Updates")) to 
(Get_Path("BackgroundImages")) -- file download complete

   --answer "File'"&&&"has been downloaded. Result==>"
   
 else
   answer "File'"&&&"has been downloaded but is too 
small==>"&&"Result==>" -- this was before I had the 404 check
   delete file Get_Path("Updates")
 end if
  end if
   end if
   
   tsNetCloseConn pID
   
   
end DownLoadBackgroundImageComplete

-

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: Friday, December 08, 2017 2:21 PM
To: How to use LiveCode
Cc: Sannyasin Brahmanathaswami
Subject: Re: libUrl tsNet and socketTimeoutInterval

Awesome Ralph:

Looks like we need to crowd fund Charles for documentation (smile)

You are about 3 days ahead of me… can you post some code snippets  of your 
methods?

 

On 12/7/17, 1:54 PM, "use-livecode on behalf of Ralph DiMola via use-livecode" 
&

Re: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Sannyasin Brahmanathaswami via use-livecode
Charles Warwick wrote:
Sorry for the confusion, tsNet does handle the ‘load’ function, effectively 
using its own asynchronous functions to replicate standard libUrl behaviour.

BR: wow. That's magic! so this means we can just proceed "as usual"  with using

load [URL] url [with message callbackMessage]
AND
the URLStatus of url

with results as expected: (see below) where the timeout will occur based on

tsNetSetTimeouts 60, 3000, 3000 , 3, 3, 12000

… and TSNet will return URLStatus value as already described in the dictionary 
just as it always has (see below.)

OK, suddenly this becomes easy.  But the we still have a "murky outback" in the 
mobile space:

How to mix this into the stew along with dynamic control creation on mobile? 
And what exactly is happening…

 where we call something like this:

command createMobileAudioPlayer pURL, pPlayerName,tRect
   if pPlayerName is among the lines of mobileControls() then 
mobileControlDelete pPlayerName -- init
   mobileControlCreate "player",pPlayerName
   put the result into sPlayerId
   -- adjust location for mobile:--### FIND OUT IF THIS IS NEEDED ON iOS
   if tRect is empty then
  put the rect of player pPlayerName into tRect 
   end if   
   if the platform is "android" then -- android player controls appear above 
the player; adjust
  -- with controller it's about 4x rect of cd player so align the bottom 
edges:
  # this his hard wired to the bottom of the card for now.
  put (the height of this card)  -70  into item 4 of tRect
  put item 4 of tRect - item 2 of tRect into tHeight
  subtract tHeight from item 2 of tRect
   end if
   mobileControlSet pPlayerName, "visible", true 
   mobileControlSet pPlayerName, "rect", tRect
   mobileControlSet pPlayerName, "showController", true 
   mobileControlSet pPlayerName, "filename", pURL 
   if pURL begins with "https" then
  showBusyIndicator true, "Loading audio..." -- add loading indicator until 
duration is available
   end if
   if mobileIdleTimerLocked() is false then mobileLockIdleTimer --jg: disallow 
screen lock
end createMobileAudioPlayer

So…in this context, the player is created, and the audio is called and the 
player starts playing. Is TSNet invoked in the background if we start the 
player?

the dictionary says:  URLStatus

"Returns the status of uploads and downloads
that were started with the load, libURLDownloadToFile,
libURLftpUpload, and libURLftpUploadFile commands."

1) what about a URL called by a mobile control? set to a Browser Widget?
2) if we use "load" and  cache the URL then set the mobile player to that URL, 
is it no longer streaming but playing the cached audio.mp3 file?
3) the player has it's own methods: if it's duration property becomes available 
then we can start playing

on playerPropertyAvailable theProperty -- msg sent when enough has content is 
loaded
   if theProperty is "duration" then
  showBusyIndicator false -- Remove the "Loading..." indicator and start 
playing
  mobileControlDo pPlayerName, "play"
   end if
end playerPropertyAvailable

is TSNet any part of these operations?


---

•   queued: on hold until a previous request to the same site is
  completed 
•   contacted: the site has been contacted but no data has been sent or
  received yet
•   requested: the URL has been requested
•   loading,bytesReceived,bytesTotal: the URL data is being
  received; items 2 and 3 of the return value provide progress
  information 
•   uploading,bytesReceived,bytesTotal: the file is being
  uploaded to the URL; items 2 and 3 of the return value
  provide progress information
•   cached: the URL is in the cache and the download is complete
•   uploaded: the application has finished uploading the file to the URL
•   error: an error occurred and the URL was not transferred
•   timeout: the application timed out when attempting to transfer the
  URL 
•   (empty): the URL was not loaded, or has been unloaded



___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Sannyasin Brahmanathaswami via use-livecode
Awesome Ralph:

Looks like we need to crowd fund Charles for documentation (smile)

You are about 3 days ahead of me… can you post some code snippets  of your 
methods?

 

On 12/7/17, 1:54 PM, "use-livecode on behalf of Ralph DiMola via use-livecode" 
 wrote:

Ok, I just got async tsNet working in IDE and Android(Testing iOS later). I 
works great! Hat tip to all the contributors. One question and one Observation:
1) How do you query the current tsNet timeout settings? I have quite a few 
places where I save the socketTimeoutInterval, set it to a new value, do 
something and then set it back to the saved timeout. I don't see a way to query 
this in the dictionary.
2) I seems the you don't need to do a "tsNetInit" in the IDE. In the IDE 
one gets "tsneterr: Already initialized". On Android this error does not occur.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net



___
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

RE: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Ralph DiMola via use-livecode
Charles,

Thanks... FYI Async tsNet in the iOS version just worked(like magic).

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 
Charles Warwick via use-livecode
Sent: Friday, December 08, 2017 5:00 AM
To: How to use LiveCode
Cc: Charles Warwick
Subject: Re: libUrl tsNet and socketTimeoutInterval

Hi Ralph,

There currently isn’t any ability to query the existing timeout values, though 
the default values are listed in the dictionary.  I will look to add that 
ability in an upcoming release.

If the Internet library is included in your application, it will automatically 
call tsNetInit for you on startup (which is what happens in the IDE) as it uses 
tsNet if it is available (and not disabled).

If your application does not include the Internet library, but does include 
tsNet, you will need to call tsNetInit.

Regards,

Charles

> On 8 Dec 2017, at 9:55 am, Ralph DiMola via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Ok, I just got async tsNet working in IDE and Android(Testing iOS later). I 
> works great! Hat tip to all the contributors. One question and one 
> Observation:
> 1) How do you query the current tsNet timeout settings? I have quite a few 
> places where I save the socketTimeoutInterval, set it to a new value, do 
> something and then set it back to the saved timeout. I don't see a way to 
> query this in the dictionary.
> 2) I seems the you don't need to do a "tsNetInit" in the IDE. In the IDE one 
> gets "tsneterr: Already initialized". On Android this error does not occur.
> 
> 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 Charles Warwick via use-livecode
> Sent: Thursday, December 07, 2017 4:53 PM
> To: How to use LiveCode
> Cc: Charles Warwick
> Subject: Re: libUrl tsNet and socketTimeoutInterval
> 
> Sorry for the confusion, tsNet does handle the ‘load’ function, effectively 
> using its own asynchronous functions to replicate standard libUrl behaviour.
> 
>> On 8 Dec 2017, at 6:44 am, Sannyasin Brahmanathaswami via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>> 
>> Thanks Charles…we have enough to go on now. 
>> 
>> well, almost
>> 
>> if I read you right "load" is not handled by TSNet (since that is libURL's 
>> own asynchronous operation?)
>> 
>> 
>> 
>> 
>> 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
>> 
>> 
>> 
>> 
>> On 12/6/17, 10:43 PM, "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:
>> 
>>   Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, 
>> it has been a long day
>> 
>> ___
>> 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


___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-08 Thread Charles Warwick via use-livecode
Hi Ralph,

There currently isn’t any ability to query the existing timeout values, though 
the default values are listed in the dictionary.  I will look to add that 
ability in an upcoming release.

If the Internet library is included in your application, it will automatically 
call tsNetInit for you on startup (which is what happens in the IDE) as it uses 
tsNet if it is available (and not disabled).

If your application does not include the Internet library, but does include 
tsNet, you will need to call tsNetInit.

Regards,

Charles

> On 8 Dec 2017, at 9:55 am, Ralph DiMola via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Ok, I just got async tsNet working in IDE and Android(Testing iOS later). I 
> works great! Hat tip to all the contributors. One question and one 
> Observation:
> 1) How do you query the current tsNet timeout settings? I have quite a few 
> places where I save the socketTimeoutInterval, set it to a new value, do 
> something and then set it back to the saved timeout. I don't see a way to 
> query this in the dictionary.
> 2) I seems the you don't need to do a "tsNetInit" in the IDE. In the IDE one 
> gets "tsneterr: Already initialized". On Android this error does not occur.
> 
> 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 Charles Warwick via use-livecode
> Sent: Thursday, December 07, 2017 4:53 PM
> To: How to use LiveCode
> Cc: Charles Warwick
> Subject: Re: libUrl tsNet and socketTimeoutInterval
> 
> Sorry for the confusion, tsNet does handle the ‘load’ function, effectively 
> using its own asynchronous functions to replicate standard libUrl behaviour.
> 
>> On 8 Dec 2017, at 6:44 am, Sannyasin Brahmanathaswami via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>> 
>> Thanks Charles…we have enough to go on now. 
>> 
>> well, almost
>> 
>> if I read you right "load" is not handled by TSNet (since that is libURL's 
>> own asynchronous operation?)
>> 
>> 
>> 
>> 
>> 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
>> 
>> 
>> 
>> 
>> On 12/6/17, 10:43 PM, "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:
>> 
>>   Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, 
>> it has been a long day
>> 
>> ___
>> 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


___
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

RE: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Ralph DiMola via use-livecode
Ok, I just got async tsNet working in IDE and Android(Testing iOS later). I 
works great! Hat tip to all the contributors. One question and one Observation:
1) How do you query the current tsNet timeout settings? I have quite a few 
places where I save the socketTimeoutInterval, set it to a new value, do 
something and then set it back to the saved timeout. I don't see a way to query 
this in the dictionary.
2) I seems the you don't need to do a "tsNetInit" in the IDE. In the IDE one 
gets "tsneterr: Already initialized". On Android this error does not occur.

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 
Charles Warwick via use-livecode
Sent: Thursday, December 07, 2017 4:53 PM
To: How to use LiveCode
Cc: Charles Warwick
Subject: Re: libUrl tsNet and socketTimeoutInterval

Sorry for the confusion, tsNet does handle the ‘load’ function, effectively 
using its own asynchronous functions to replicate standard libUrl behaviour.

> On 8 Dec 2017, at 6:44 am, Sannyasin Brahmanathaswami via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Thanks Charles…we have enough to go on now. 
> 
> well, almost
> 
> if I read you right "load" is not handled by TSNet (since that is libURL's 
> own asynchronous operation?)
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> On 12/6/17, 10:43 PM, "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:
> 
>Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, 
> it has been a long day
> 
> ___
> 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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Charles Warwick via use-livecode
Sorry for the confusion, tsNet does handle the ‘load’ function, effectively 
using its own asynchronous functions to replicate standard libUrl behaviour.

> On 8 Dec 2017, at 6:44 am, Sannyasin Brahmanathaswami via use-livecode 
>  wrote:
> 
> Thanks Charles…we have enough to go on now. 
> 
> well, almost
> 
> if I read you right "load" is not handled by TSNet (since that is libURL's 
> own asynchronous operation?)
> 
> 
> 
> 
> www.himalayanacademy.com  Get the SivaSiva 
> App today (for iPhone and iPad)
> https://itunes.apple.com/us/app/sivasiva/id1271260502?mt=8
> 
> 
> 
> 
> On 12/6/17, 10:43 PM, "use-livecode on behalf of Charles Warwick via 
> use-livecode"  use-livecode@lists.runrev.com> wrote:
> 
>Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, 
> it has been a long day
> 
> ___
> 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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Sannyasin Brahmanathaswami via use-livecode
Thanks Charles…we have enough to go on now. 

well, almost

if I read you right "load" is not handled by TSNet (since that is libURL's own 
asynchronous operation?)

 


www.himalayanacademy.com  Get the SivaSiva App 
today (for iPhone and iPad)
https://itunes.apple.com/us/app/sivasiva/id1271260502?mt=8
 

 

On 12/6/17, 10:43 PM, "use-livecode on behalf of Charles Warwick via 
use-livecode"  wrote:

Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, 
it has been a long day

___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Charles Warwick via use-livecode
Sorry, divide my figures for the last parameter to tsNetSetTimeouts by 8, it 
has been a long day!

> On 7 Dec 2017, at 6:33 pm, Charles Warwick  
> wrote:
> 
> BR,
> 
> 
>> OK, now going over to the forum on this dropbox thread I see Jacque's and 
>> Charle's comments. 5 secs seems a little long.. so if we use the algorithm 
>> "We want to tell users what is up or dim content options from remote servers 
>> in 3 seconds"  (and FTP is not in the cards) we get: 
>> 
>> tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000
>> 
>> This translates "you must have a 96kbps connection or else…"  right?
>> 
>> FYI the dictionary does not declare units for the pLowSpeedTime, it should… 
>> I've assumed integers = seconds and not milliseconds for param 5.
> 
> 
> I will get that fixed in the dictionary in the next version, thanks for 
> letting me know.
> 
> tsNetSetTimeouts uses the last two parameters to determine if a connection 
> should be dropped if the “average” speed of the transfer falls below the 
> values set.
> 
> To use your example, if you want to ensure that the average speed of the 
> transfer does not fall below 96kbps, calculating the average speed over a 3 
> second period, you would specify a value of 3 for the second last parameter 
> and 96000 (96kbps x 1000 bytes per kB) for the last parameter to 
> tsNetSetTimeouts.
> 
> 
>> Second  (dumb) question: how do we trap for the timeout? we keep checking 
>> the tsNetStatusCallback on a loop? and if and when we see timeout we inform 
>> the user? But we need a connectionID, so how do we extract a connectionID 
>> from put/get/set/ http urls? where we are targeting  browser widget on a 
>> card. Or a mobilePlayer?
> 
> 
> If you are using a standard synchronous libUrl request (put URL, post x to 
> URL, etc...) then the request will abort as soon as the connection speed 
> falls below the threshold specified and an error will be stored in the result.
> 
> For asynchronous tsNet requests, the callback message will be sent with an 
> error code indicating the failure.
> 
> Hope that helps,
> 
> Cheers.
> 
> Charles
> 


___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Charles Warwick via use-livecode
BR,


> On 7 Dec 2017, at 5:00 am, Sannyasin Brahmanathaswami via use-livecode 
>  wrote:
> 
> Matthias Rebbe wrote:
> 
>The connection ID is only used/needed when you use the asynchronous 
> commands of tsNet.   The synchronous commands like tsNetUploadSync or 
> tsNetFileUploadSync or others (they are ending with Sync) do not use 
> connectionIDs. And i assume that put URL and get URL are using the 
> synchronous commands.
>Matthias
> ---
> OK then…. if we do this:
> 
> 1) tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000
> 
> 2) get url….


At this point, if the speed drops below 12kbps, then the get URL command will 
return with the result set to indicate failure.


> 
> 3) how do we trap the SocketTimeOut  whose syntax requires a socketID
> 
> from dictionary: 
> 
> Syntax:
> 
> socketTimeout pSocketID
> 
> ?


tsNet does not use standard LiveCode sockets, so socketTimeout does not affect 
connections using it.

Regards,

Charles

> 
> 
> 
> ___
> 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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-07 Thread Charles Warwick via use-livecode
BR,


> OK, now going over to the forum on this dropbox thread I see Jacque's and 
> Charle's comments. 5 secs seems a little long.. so if we use the algorithm 
> "We want to tell users what is up or dim content options from remote servers 
> in 3 seconds"  (and FTP is not in the cards) we get: 
> 
> tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000
> 
> This translates "you must have a 96kbps connection or else…"  right?
> 
> FYI the dictionary does not declare units for the pLowSpeedTime, it should… 
> I've assumed integers = seconds and not milliseconds for param 5.


I will get that fixed in the dictionary in the next version, thanks for letting 
me know.

tsNetSetTimeouts uses the last two parameters to determine if a connection 
should be dropped if the “average” speed of the transfer falls below the values 
set.

To use your example, if you want to ensure that the average speed of the 
transfer does not fall below 96kbps, calculating the average speed over a 3 
second period, you would specify a value of 3 for the second last parameter and 
96000 (96kbps x 1000 bytes per kB) for the last parameter to tsNetSetTimeouts.


> Second  (dumb) question: how do we trap for the timeout? we keep checking the 
> tsNetStatusCallback on a loop? and if and when we see timeout we inform the 
> user? But we need a connectionID, so how do we extract a connectionID from 
> put/get/set/ http urls? where we are targeting  browser widget on a card. Or 
> a mobilePlayer?


If you are using a standard synchronous libUrl request (put URL, post x to URL, 
etc...) then the request will abort as soon as the connection speed falls below 
the threshold specified and an error will be stored in the result.

For asynchronous tsNet requests, the callback message will be sent with an 
error code indicating the failure.

Hope that helps,

Cheers.

Charles



___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-06 Thread Sannyasin Brahmanathaswami via use-livecode
Matthias Rebbe wrote:

The connection ID is only used/needed when you use the asynchronous 
commands of tsNet.   The synchronous commands like tsNetUploadSync or 
tsNetFileUploadSync or others (they are ending with Sync) do not use 
connectionIDs. And i assume that put URL and get URL are using the synchronous 
commands.
Matthias
---
OK then…. if we do this:

1) tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000

2) get url….

3) how do we trap the SocketTimeOut  whose syntax requires a socketID

from dictionary: 

Syntax:

socketTimeout pSocketID

?



___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-06 Thread Matthias Rebbe via use-livecode
The connection ID is only used/needed when you use the asynchronous commands of 
tsNet.

The synchronous commands like tsNetUploadSync or tsNetFileUploadSync or others 
(they are ending with Sync) do not use connectionIDs. And i assume that put URL 
and get URL are using the synchronous commands.

Matthias

> Am 06.12.2017 um 17:08 schrieb Sannyasin Brahmanathaswami via use-livecode 
> >:
> 
> Still searching… let's break this down a bit
> 
> Almost TSNet functions and commands require a connectionID. In some instances 
> these are aribitrary strings assigned by the dev on the initial call, then 
> used later.
> 
> but what if we use the simple libURL commands?
> 
> get url "https://www.domain.com/ping.txt "
> 
> OR
> 
> set a  mobile player to a URL and start the player
> 
> OR
> 
> use "load"
> 
> how do we extract a connectionID?
> 
> use case is to check the socketTimeout pSocketID (which may not be the same 
> as a "connectionID" .
> 
> I am still searching the dictionary for clues on how it all works. Not clear 
> on using plain libURL commands with TSNet… 
> Or if best practice is to switch over entirely to TSnet "vocabulary"  for all 
> URL calls. will check for lessons on this later..
> 
> Goal is preloading images or pages in books (aka "load") and monitoring 
> bandwidth and triggering notifications in low bandwidth conditions.
> 
> BR
> 
> 
> 
>FYI the dictionary does not declare units for the pLowSpeedTime, it 
> should… I've assumed integers = seconds and not milliseconds for param 5.
> 
>Second  (dumb) question: how do we trap for the timeout? we keep checking 
> the tsNetStatusCallback on a loop? and if and when we see timeout we inform 
> the user? But we need a connectionID, so how do we extract a connectionID 
> from put/get/set/ http urls? where we are targeting  browser widget on a 
> card. Or a mobilePlayer?
> 
> ___
> 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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-06 Thread Sannyasin Brahmanathaswami via use-livecode
Still searching… let's break this down a bit

Almost TSNet functions and commands require a connectionID. In some instances 
these are aribitrary strings assigned by the dev on the initial call, then used 
later.

but what if we use the simple libURL commands?

get url "https://www.domain.com/ping.txt;

OR

 set a  mobile player to a URL and start the player

OR

use "load"

how do we extract a connectionID?

use case is to check the socketTimeout pSocketID (which may not be the same as 
a "connectionID" .

I am still searching the dictionary for clues on how it all works. Not clear on 
using plain libURL commands with TSNet… 
Or if best practice is to switch over entirely to TSnet "vocabulary"  for all 
URL calls. will check for lessons on this later..

Goal is preloading images or pages in books (aka "load") and monitoring 
bandwidth and triggering notifications in low bandwidth conditions.

BR



FYI the dictionary does not declare units for the pLowSpeedTime, it should… 
I've assumed integers = seconds and not milliseconds for param 5.

Second  (dumb) question: how do we trap for the timeout? we keep checking 
the tsNetStatusCallback on a loop? and if and when we see timeout we inform the 
user? But we need a connectionID, so how do we extract a connectionID from 
put/get/set/ http urls? where we are targeting  browser widget on a card. Or a 
mobilePlayer?

___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-05 Thread Sannyasin Brahmanathaswami via use-livecode
Finding answers faster than expected. Spotify seems to want minimum 96kbps. If 
we use this for our own app/mp3's delivered by CloudFlare -- God only knows it 
that makes any sense at all… but we have to start somewhere…

Now, I'm not super savvy on these units but I think this means  96 X 125 
(bytes) = 12000 bytes

OK, now going over to the forum on this dropbox thread I see Jacque's and 
Charle's comments. 5 secs seems a little long.. so if we use the algorithm "We 
want to tell users what is up or dim content options from remote servers in 3 
seconds"  (and FTP is not in the cards) we get: 

tsNetSetTimeouts 60, 3000, 3000 , , 3, 12000

This translates "you must have a 96kbps connection or else…"  right?

FYI the dictionary does not declare units for the pLowSpeedTime, it should… 
I've assumed integers = seconds and not milliseconds for param 5.

Second  (dumb) question: how do we trap for the timeout? we keep checking the 
tsNetStatusCallback on a loop? and if and when we see timeout we inform the 
user? But we need a connectionID, so how do we extract a connectionID from 
put/get/set/ http urls? where we are targeting  browser widget on a card. Or a 
mobilePlayer?

set the url of browser "webViews" to https://MyDomain.com; 

or a connection ID for this:

   mobileControlSet pPlayerName, "filename", pURL  

??

FWIW some useful links

 
https://www.highspeedinternet.com/resources/how-much-speed-do-i-need-for-pandora-and-spotify/
http://www.bandwidthplace.com/what-are-the-bandwidth-specifications-for-pandora-spotify-itunes-radio-and-beats-music-article/
https://thomas.vanhoutte.be/miniblog/spotify-data-consumption/T
https://www.highspeedinternet.com/resources/how-much-speed-do-i-need-for-pandora-and-spotify/

and interesting tool: push this URL to a browser widget in your mobile app.

http://www.bandwidthplace.com

and walk around different locations and check your bandwidth…

someone might cook up a native LC widget for this purpose.

BR


 

On 12/5/17, 9:19 AM, "use-livecode on behalf of Sannyasin Brahmanathaswami via 
use-livecode"  wrote:

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)

___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-12-05 Thread Sannyasin Brahmanathaswami via use-livecode
@ Charles (and anyone else)

using

tsNetSetTimeouts 30, 0, 30, 6, 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"  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”.

___
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

Re: libUrl tsNet and socketTimeoutInterval

2017-11-22 Thread Charles Warwick via use-livecode
Hi Ralph,

You are correct, as tsNet does not use the standard LiveCode sockets, it does 
not pay attention to the socketTimeoutInterval.

However, rather than disabling tsNet, you can resolve any app hangs related to 
socket timeouts by using the tsNetSetTimeouts command which allows you to 
control how long the external will wait before considering a connection lost.

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”.

Regards,

Charles


> On 23 Nov 2017, at 6:27 am, Ralph DiMola via use-livecode 
>  wrote:
> 
> libURL now using tsNet is a great addition to v8 but it seems to have broken 
> my code without warning unless I missed this warning in the release notes. I 
> seems that when tsNet was included in v8 the property socketTimeoutInterval 
> does nothing when doing ==> put url("https://"&":") into tWebData 
> <==. This explains a few reported app hangs. In the IDE tried ==> dispatch 
> "revUnloadLibrary" to stack "tsNetLibURL" <== but socketTimeoutInterval still 
> does nothing. Ran the stack in 7.1.4 and socketTimeoutInterval works as 
> expected. It's my understanding that when tsNet is unloaded libUrl falls back 
> to using sockets and the socketTimeoutInterval property should be respected.
> 
> I'm using 8.1.7
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> 
> ___
> 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