Page 1 of 2
is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 3:44 pm
by Monox18
I can see load url is asynchronous but I can't tell if it is UDP or TCP. Same question for the tsNet library, which I hope to try out soon. Are the commands TCP or UDP? I'm supposing they are probably TCP
Re: is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 4:16 pm
by FourthWorld
Monox18 wrote: ↑Wed May 20, 2020 3:44 pm
I can see load url is asynchronous but I can't tell if it is UDP or TCP.
TCP.
Same question for the tsNet library, which I hope to try out soon. Are the commands TCP or UDP? I'm supposing they are probably TCP
tsNet covers a wide range of functionality. Most of it is TCP, there may be some UDP operations in there too. Any that use UDP will be clearly noted as such in the documentation.
Re: is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 6:20 pm
by Monox18
Got it. Thank you!
Re: is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 7:58 pm
by FourthWorld
Glad that helped. But now you've got me curious: are you using UDP in your app? If so, for what functionality?
Re: is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 8:13 pm
by Monox18
I'm building a SCADA for a machine. I have a local server reading and writing data to the PLC controlling the machine. LiveCode is used for the client App. So the app is all about networking. Calling and consuming REST services.
The problem began when I was originally using "put url into" to load the data. It was very slow. I tested times, but forgot the exact numbers. Around 120ms in a LAN.
Then I discovered "load url into". This one is async. I also improved the slow processing of my code. Now it takes 10ms asyn data download and 20ms painting the GUI (blocking handler). I'm updating the GUI every 200ms, leaving 180ms free to deal with responsivenes, which is fine. This now feels much better. However this is in a LAN. I don't know how much slower it will become once it is in the cloud.
Although I'm happy with the current results, a friend explained me a bit of the OSI model and what is TCP/UDP. I don't have networking background at all. So, apparently UDP is used to send data periodically in which it is ok to loss a few packages. Since I'm reading the data periodically, that's fine.
So I wanted to test UDP connections to make it even faster, and make sure it works well once I put the app in the cloud. Haven't tested tsNet yet, but it looks very promising.
Re: is "load url" TCP or UDP? also tsNet
Posted: Wed May 20, 2020 10:08 pm
by FourthWorld
Thanks for describing that. I'm glad I asked, that sounds like a cool project.
Keep us posted if we can provide any other help.
Re: is "load url" TCP or UDP? also tsNet
Posted: Thu May 21, 2020 9:05 am
by mrcoollion
More information about tsNet here:
https://www.techstrategies.com.au/tsnet ... -external/
The tsNet LiveCode External utilizes the libcurl (
https://curl.haxx.se/), libssh2 (
https://www.libssh2.org/) and OpenSSL (
https://www.openssl.org/) libraries to provide its feature set. The lubcurl lib is solely based on TCP. The libssh2 and OpenSSL libs i think can utilize UDP (e.g. for streaming video) . I do not know and cannot find how to force UDP or TCP transmissions with tsNet. Maybe you could ask techstrategies.com ?
I have been working with tsNet in my current application for retrieving stock data and tsNet works really well, you should test it in your situation. Also test the difference in synchronous and asynchronous transfer modes. Might make a big difference in time.
Regards,
Paul
Re: is "load url" TCP or UDP? also tsNet
Posted: Thu May 21, 2020 10:20 am
by bangkok
Speaking about tsNet...
Do you know that LC 9.6 (rc2 now) is shipped with tsNet 1.40 (if you check, LC 9.5.1 came with version 1.39, and LC 8.1.0 with 1.35)
And tsNet 1.40 brings a
truckload of new parameters.
An example here, with the command tsNetUploadFile...
https://www.techstrategies.com.au/tsnet ... UploadFile
It's something that should deserve more awareness, and more... examples and tests (personally, i do not have the slightest idea on how to use many of those new exciting parameters

).
Re: is "load url" TCP or UDP? also tsNet
Posted: Thu May 21, 2020 2:21 pm
by Monox18
Indeed version 1.40 brings a bazillion options. With that huge amount of customization and both Sync/Async support, I have the feeling that tsNet will be enough to accomplish what I want. Soon I will discover it once I test it with the machine in the cloud. Tnx for the resources Paul, they help me to understand better how tsNet works.
For sure will ask more questions as I continue developing.
Re: is "load url" TCP or UDP? also tsNet
Posted: Thu May 21, 2020 5:30 pm
by FourthWorld
cURL is a great foundation, a de facto industry standard. As much as I admire Charles' work with wrapping it in tsNet, limiting it to proprietary editions leaves LC among the very few open source languages has that no cURL wrapper.
Maybe one of us will find enough time to use LCB to wrap cURL for the vast majority of LC users enjoying the Community Edition.
Re: is "load url" TCP or UDP? also tsNet
Posted: Fri May 22, 2020 4:36 am
by mwieder
Why bother with cURL when httpie is available?
https://httpie.org/
Re: is "load url" TCP or UDP? also tsNet
Posted: Fri May 22, 2020 6:01 am
by FourthWorld
Hmmm....command line...suitable license...I like it! Anyone here have time to write a wrapper lib for that?
Re: is "load url" TCP or UDP? also tsNet
Posted: Fri May 22, 2020 2:50 pm
by mrcoollion
Looks nice but only support for Linux, macOS and Windows, NO Android

.
Re: is "load url" TCP or UDP? also tsNet
Posted: Fri May 22, 2020 4:18 pm
by mwieder
Richard- I think the wrapper you're looking for is called "shell".

Re: is "load url" TCP or UDP? also tsNet
Posted: Fri May 22, 2020 5:59 pm
by FourthWorld
mwieder wrote: ↑Fri May 22, 2020 4:18 pm
Richard- I think the wrapper you're looking for is called "shell".
If the syntax is straightfoward enough that'll work. Concatenation can sometimes be cumbersome, so if I need to use it I may still want a few wrappers for some things. But very good to know about httpie - thanks for that. Nice to have a solution for deeper URL handling for the vast majority of LC users running the Community Edition.