Re: [ANN] Release 8.1.5 -- tsneterr

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
I am porting a large project from LC 7 to 8.1.5.  Occasionally, I get this error when accessing the internet:  “tsneterr: Not initialised” (misspelled, by the way).   It works fine for a while, then it just fails.  And, once it fails you have to completely restart.  Sometimes LC even crashes!

It seems to be happening when one network connection isn’t finished and it tries to start another one.   I did not have this problem in LC 7 using libURL.  So, I’m pretty confident it’s something with tsNet.

If it’s because tsNet calls are crashing into each other, and If all calls [by default] are blocking, how could one connection be started before the previous one is completed?

I had this problem with previous versions of 8.1, but I was hoping it would be fixed in 8.1.5.

Anyone have any insight?   I would very much like to move forward with tsNet, but if this isn’t resolved, I can’t.  Is it possible to continue with 8.1.5, and still use the old libURL?


-Dan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
Dan,

before creating the standalone you can disable the tsNet external
To unload:

  dispatch "revUnloadLibrary" to stack "tsNetLibUrl"

To load again:
  dispatch "revLoadLibrary" to stack “tsNetLibUrl"

Regards,
Matthias

Matthias Rebbe
+49 5741 310000
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌

> Am 11.07.2017 um 19:33 schrieb Dan Friedman via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> I am porting a large project from LC 7 to 8.1.5.  Occasionally, I get this error when accessing the internet:  “tsneterr: Not initialised” (misspelled, by the way).   It works fine for a while, then it just fails.  And, once it fails you have to completely restart.  Sometimes LC even crashes!
>
> It seems to be happening when one network connection isn’t finished and it tries to start another one.   I did not have this problem in LC 7 using libURL.  So, I’m pretty confident it’s something with tsNet.
>
> If it’s because tsNet calls are crashing into each other, and If all calls [by default] are blocking, how could one connection be started before the previous one is completed?
>
> I had this problem with previous versions of 8.1, but I was hoping it would be fixed in 8.1.5.
>
> Anyone have any insight?   I would very much like to move forward with tsNet, but if this isn’t resolved, I can’t.  Is it possible to continue with 8.1.5, and still use the old libURL?
>
>
> -Dan
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
Hi Dan,

reading my comment makes me think that it is confusing.
What i wanted to say was,

To use the “old” libURL unload tsNET as described, then create the standalone.
The standalone then will use the old libURL.

One little caveat. The created standalone still contains the tsNET external, although it does not use it. See Bug 19900 <http://quality.livecode.com/show_bug.cgi?id=19900>

Regards,
Matthias

Matthias Rebbe
+49 5741 310000
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌

> Am 11.07.2017 um 21:26 schrieb Matthias Rebbe via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> Dan,
>
> before creating the standalone you can disable the tsNet external
> To unload:
>
>  dispatch "revUnloadLibrary" to stack "tsNetLibUrl"
>
> To load again:
>  dispatch "revLoadLibrary" to stack “tsNetLibUrl"
>
> Regards,
> Matthias
>
> Matthias Rebbe
> +49 5741 310000
> ‌matthiasrebbe.eu <http://matthiasrebbe.eu/> <http://matthiasrebbe.eu/ <http://matthiasrebbe.eu/>>‌
>
>> Am 11.07.2017 um 19:33 schrieb Dan Friedman via use-livecode <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>:
>>
>> I am porting a large project from LC 7 to 8.1.5.  Occasionally, I get this error when accessing the internet:  “tsneterr: Not initialised” (misspelled, by the way).   It works fine for a while, then it just fails.  And, once it fails you have to completely restart.  Sometimes LC even crashes!
>>
>> It seems to be happening when one network connection isn’t finished and it tries to start another one.   I did not have this problem in LC 7 using libURL.  So, I’m pretty confident it’s something with tsNet.
>>
>> If it’s because tsNet calls are crashing into each other, and If all calls [by default] are blocking, how could one connection be started before the previous one is completed?
>>
>> I had this problem with previous versions of 8.1, but I was hoping it would be fixed in 8.1.5.
>>
>> Anyone have any insight?   I would very much like to move forward with tsNet, but if this isn’t resolved, I can’t.  Is it possible to continue with 8.1.5, and still use the old libURL?
>>
>>
>> -Dan
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Dan,

The error message "Not initialised" (the spelling is correct depending
on where you live ;-) ) indicates that the tsNet external isn't running.

If you are using libUrl which I am guessing you are, tsNet is
initialised on startup, so this would indicate that it has either been
shut down by calling tsNetClose directly, or by a call to the libUrl
"resetAll" or "libUrlCancel" commands (which temporarily shut down the
external and start it back up to clear all connections).

I have seen code posted on the list in the past which invoked "resetAll"
to deal with issues in older versions of libUrl.  Do you use these
commands at all in your project?

Regards,

Charles


On 12/07/2017 3:33 AM, Dan Friedman via use-livecode wrote:

> I am porting a large project from LC 7 to 8.1.5.  Occasionally, I get this error when accessing the internet:  “tsneterr: Not initialised” (misspelled, by the way).   It works fine for a while, then it just fails.  And, once it fails you have to completely restart.  Sometimes LC even crashes!
>
> It seems to be happening when one network connection isn’t finished and it tries to start another one.   I did not have this problem in LC 7 using libURL.  So, I’m pretty confident it’s something with tsNet.
>
> If it’s because tsNet calls are crashing into each other, and If all calls [by default] are blocking, how could one connection be started before the previous one is completed?
>
> I had this problem with previous versions of 8.1, but I was hoping it would be fixed in 8.1.5.
>
> Anyone have any insight?   I would very much like to move forward with tsNet, but if this isn’t resolved, I can’t.  Is it possible to continue with 8.1.5, and still use the old libURL?
>
>
> -Dan
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Matthias,

If I build the standalone with tsNet selected, could I call:

       dispatch "revUnloadLibrary" to stack "tsNetLibUrl"

at runtime to switch back to libURL?   If so, this would give me the option to use either one.

Thanks!
-Dan


On 7/11/17, 6:13 PM, "use-livecode on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:

    Hi Dan,
   
    reading my comment makes me think that it is confusing.
    What i wanted to say was,
   
    To use the ?old? libURL unload tsNET as described, then create the standalone.
    The standalone then will use the old libURL.
   
    One little caveat. The created standalone still contains the tsNET external, although it does not use it. See Bug?19900 <http://quality.livecode.com/show_bug.cgi?id=19900>
   
    Regards,
    Matthias
   
    Matthias Rebbe
    +49 5741 310000
    ?matthiasrebbe.eu <http://matthiasrebbe.eu/>?

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
You mean, you want to call that in the standalone?
I am not sure. I would say this  is a question either for Charles Warwick or the people at Livecode.
 

> Am 12.07.2017 um 17:13 schrieb Dan Friedman via use-livecode <[hidden email]>:
>
> Matthias,
>
> If I build the standalone with tsNet selected, could I call:
>
>       dispatch "revUnloadLibrary" to stack "tsNetLibUrl"
>
> at runtime to switch back to libURL?   If so, this would give me the option to use either one.
>
> Thanks!
> -Dan
>
>
> On 7/11/17, 6:13 PM, "use-livecode on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:
>
>    Hi Dan,
>
>    reading my comment makes me think that it is confusing.
>    What i wanted to say was,
>
>    To use the ?old? libURL unload tsNET as described, then create the standalone.
>    The standalone then will use the old libURL.
>
>    One little caveat. The created standalone still contains the tsNET external, although it does not use it. See Bug?19900 <http://quality.livecode.com/show_bug.cgi?id=19900>
>
>    Regards,
>    Matthias
>
>    Matthias Rebbe
>    +49 5741 310000
>    ?matthiasrebbe.eu <http://matthiasrebbe.eu/>?
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Charles,

Yes, I do have resetAll in my scripts.   I use it when a communications error has occurred as a way to reset and try again.  If tsNet is in play, I gather I should not call resetAll?  If not, is there something else I should be doing?  Also, is there a way (via a property) to determine if tsNet or libURL is handling the network?

Thank you!
 
-Dan
 

On 7/12/17, 9:38 AM, "use-livecode on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:

    Hi Dan,
   
    The error message "Not initialised" (the spelling is correct depending
    on where you live ;-) ) indicates that the tsNet external isn't running.
   
    If you are using libUrl which I am guessing you are, tsNet is
    initialised on startup, so this would indicate that it has either been
    shut down by calling tsNetClose directly, or by a call to the libUrl
    "resetAll" or "libUrlCancel" commands (which temporarily shut down the
    external and start it back up to clear all connections).
   
    I have seen code posted on the list in the past which invoked "resetAll"
    to deal with issues in older versions of libUrl.  Do you use these
    commands at all in your project?
   
    Regards,
   
    Charles

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
Hi Dan,

The resetAll command is very destructive, in that it closes all
currently open connections.  In certain circumstances it has been
required when using the traditional libUrl library to work around
network errors and in order to maintain feature parity, it does also
work with tsNet.

However I generally would not recommend using it with tsNet as there are
other mechanisms available in tsNet to enable it to handle network
problems more gracefully.

I recommend taking a look at the tsNetSetTimeouts function that is
available in tsNet 1.2.10 (which is included in LC 8.1.5).  In
particular, have a look at the pLowSpeedTime and pLowSpeedLimit
parameters to that function.  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.

This should prevent connections from stalling and not returning - which
is generally where the use of resetAll comes into play.

If you are using apps within a mobile environment where network
connectivity can come and go frequently, it may also be worth setting
"tsNetLibUrlReuseConnection false" at the start of your application.

Having said all of that, it is still possible to use resetAll, though
some care must be taken.  With tsNet, it briefly disables the external
and then re-enables it.  My guess is that another handler is trying to
process a URL request while the resetAll is being performed.

The easiest way to see if tsNet is in use by libUrl is:

putthebehaviorofstack"revLibUrl"intotLibUrlDriver
if tLibUrlDriver isemptythen
answer"tsNet is disabled"
else
answer"tsNet in use"
end if

Best Regards,

Charles

On 13/07/2017 4:34 AM, Dan Friedman via use-livecode wrote:

> Charles,
>
> Yes, I do have resetAll in my scripts.   I use it when a communications error has occurred as a way to reset and try again.  If tsNet is in play, I gather I should not call resetAll?  If not, is there something else I should be doing?  Also, is there a way (via a property) to determine if tsNet or libURL is handling the network?
>
> Thank you!
>  
> -Dan
>  
>
> On 7/12/17, 9:38 AM, "use-livecode on behalf of [hidden email]" <[hidden email] on behalf of [hidden email]> wrote:
>
>      Hi Dan,
>      
>      The error message "Not initialised" (the spelling is correct depending
>      on where you live ;-) ) indicates that the tsNet external isn't running.
>      
>      If you are using libUrl which I am guessing you are, tsNet is
>      initialised on startup, so this would indicate that it has either been
>      shut down by calling tsNetClose directly, or by a call to the libUrl
>      "resetAll" or "libUrlCancel" commands (which temporarily shut down the
>      external and start it back up to clear all connections).
>      
>      I have seen code posted on the list in the past which invoked "resetAll"
>      to deal with issues in older versions of libUrl.  Do you use these
>      commands at all in your project?
>      
>      Regards,
>      
>      Charles
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ANN] Release 8.1.5 -- tsneterr

Mark Wieder via use-livecode
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" <[hidden email] on behalf of [hidden email]> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...