how are URL / libUrl / tsNet related?
mark at livecode.com
Mon May 22 04:16:37 EDT 2017
On 2017-05-22 09:47, Tiemo Hollmann TB via use-livecode wrote:
> I feel, that I am missing some basics about URL / libUrl / tsNet.
> I thought, when using the keyword "URL" like in "put URL foo into res"
> has used under the hood in the past functions from libUrl. And I
> since LC 8 or so libURL was replaced by tsNet, so when using today the
> keyword URL it uses under the hood tsNet.
There are two types of URL related functionality in the engine:
- those provided by syntax (e.g. load url, url, post etc.)
- those provided by libUrl prefixed functions and commands.
The syntax works because the engine sends a message (such as loadUrl)
the message path to handle any occurrences of 'load url X'. The other
and commands because libUrl is just a library stack/backscript.
The tsNet external provides a richer set of functionality via a
tsNet functions and commands - the tsNet functionality is a superset of
provided by libUrl.
When we started bundling tsNet, Charles modified the built-in libUrl so
it consists of a universal library script, and a 'driver' script - the
script provides the public API (both for functions and syntax) and then
dispatches to a (private) driver library which actually does the work.
tsNet comes with a libUrl driver which implements the whole of libUrl's
functionality via tsNet.
If you just choose to include libUrl, then you will get the libUrl
(which runs using engine socket commands); if you also include tsNet,
it will install its driver on startup; so libUrl will then be doing all
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the Use-livecode