Thanks Charles - yep that sounds exactly the problem. I guess I should have 
searched the bug database - it might have saved me some unnecessary panic. 
Anyway, tsNetReuseConnection false seems to work just fine for now. When I have 
some more time I'll delve into the tsNet commands a bit more and switch to 
using some of the asynchronous functions.

Regards,

Terry...

Sent from my iPad

> On 1 Jun 2017, at 7:48 pm, Charles Warwick via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Hi Terry,
> 
> I think this is the same issue as has been reported here that I am looking 
> into:
> 
> http://quality.livecode.com/show_bug.cgi?id=19656
> 
> At this point in time, issuing "tsNetLibUrlReuseConnection false" is the best 
> solution, as this will stop tsNet from trying to re-use an existing open 
> connection to a server.
> 
> If you are using tsNet functions directly, the equivalent option can be set 
> by using tSettings["no_reuse"] to true and passing that to the function.  For 
> example:
> 
> local tHeaders, tRecvHeaders, tResult, tBytes, tSettings
> put true into tSettings["no_reuse"]
> put tsNetGetSync("http://www.livecode.com";, tHeaders, tRecvHeaders, tResult, 
> tBytes, tSettings) into tData
> 
> Best Regards,
> 
> Charles
> 
> 
> 
>> On 1/06/2017 1:24 PM, Terry Judd via use-livecode wrote:
>> OK, I think I have a workaround although I’m not sure whether it is a good 
>> solution or not.
>> 
>> If I include the line...
>> 
>> tsNetLibUrlReuseConnection false
>> 
>> ...in my preopenstack handler then the delay/hang seems to disappear – i.e. 
>> I get an almost immediate response if the url isn’t available. I’m not at 
>> all sure what this achieves but it seems that a new connection that can’t 
>> connect doesn’t experience the same problem as an existing connection that 
>> was previously successful.
>> 
>> Anyway, panic averted for now but any insights into the best way to deal 
>> with this stuff would be appreciated.
>> 
>> Terry...
>> 
>> 
>> 
>> On 1/06/2017 11:44 am, "use-livecode on behalf of Terry Judd via 
>> use-livecode" <use-livecode-boun...@lists.runrev.com on behalf of 
>> use-livecode@lists.runrev.com> wrote:
>> 
>>     OK – I have a bit of a serious issue on iOS where if I lose wifi 
>> connectivity the first attempt to get data from a url causes problems.
>>          I’m attempting to upload a file to Dropbox (that stuff all works 
>> fine) and I do an initial test to see whether the device is online (by 
>> trying to access a url). If it is I proceed with the upload, if not I just 
>> save a local copy of the file. Anyway, the first time I do the test the 
>> request seems to take forever (minutes?) – which I don’t have (I need the 
>> request to be completed within a few seconds). The second time around is ok 
>> though.
>>          Any ideas on how I prevent this initial ‘hang’. Is it possible to 
>> set a shorter timeout or something?
>>          Terry...
>>     _______________________________________________
>>     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

Reply via email to