tsNet or not tsNet?

Charles Warwick charles at techstrategies.com.au
Mon Mar 5 06:27:49 EST 2018


Hi Graham,

In commercial versions of LiveCode, the default behaviour of the Internet library (libUrl) is to include and use tsNet.

It calls tsNetInit on startup so that you don’t need to do that separately.

Hope that helps,

Charles

> On 5 Mar 2018, at 7:21 pm, Graham Samuel via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I’ve been executing this line of script in an app made on a Mac with LC 9.0.0 dp11
> get URL “http://www.myserver.com/mytextfile <http://www.myserver.com/mytextfile>.txt
> 
> It works fine, but I also wanted to detect what happens when the connection can't be established, so I made the command fail by switching off internet access on my machine. I got an error in ‘the result’, as expected. Or at least I got one when the line was executed in the IDE, and this was a tsNet error. As I had not initialised tsNet in my script - according to the dictionary, this **must** be done before tsNet functions are used - I concluded that the IDE had done it for me.
> 
> Fair enough, but I then reasoned that if I wanted to see the same kind of explicit error messages in my standalone, I would have to include a call to tsNetInit in my script. However, I created a little test app which **doesn’t** make any tsNet calls, certainly not initialising the package, but I still get a tsNet style error, e.g.
> 
>> tsneterr: (6) Could not resolve host: www.myserver.com 
> 
> So, what’s going on? Is tsNet now always included in a standalone, and if so, how does it get initialised?
> 
> Puzzled, not for the first time.
> 
> Graham
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list