Encoding Arrays with File Paths

Bob Sneidar bobsneidar at iotecdigital.com
Tue Feb 25 11:18:29 EST 2025


I played around with this last night, and determined that the length does not have to be sent, the receiving process can simply keep reading for n characters, appending the data to a low level file in a repeat loop until the it variable is empty. I tried this and the entire payload was received.

I think the advantage to this method is that I do not have to worry about file size, as any file can be transferred using this method, whereas otherwise a file can theoretically be large enough to overwhelm the sender or receiver.

Bob S


On Feb 24, 2025, at 5:21 PM, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com> wrote:

On 25/02/2025 00:35, Bob Sneidar via use-livecode wrote:
Okay I verified in my actual code. This is problematic if I don’t know how much data is actually going to be sent. I ended up with roughly 138,000 bytes before it choked. I supposed I could start with 128k chunks then dial it down if it’s too much. I wish I know what the limiting factors are because this has to work over the internet.

No, please don't start down the path of "dialling down"; the point at which it will fail is highly variable dependent on network conditions.

Your easiest and safest way (or at least, the one I find easiest) is to use the length + data approach.

If you don't know the total amount when you are about to start sending, then you simply package up what you *do* know as a length+data, and use a special case check to know when everything has been sent.

<snip>


More information about the use-livecode mailing list