Yes and I replied to the ticket. The base64encoded data received is the same as 
that which was sent, so I do not think data length is the issue. Also if I send 
the file data just by itself without putting it into an array, the file arrives 
at the server intact and can be base64Decoded and decrypted and saved to disk 
with no issues. Further if I run the server on a MacOS device it works fine. 

I think that read from socket with messages will continue to read until it 
encounters an EOF, and THEN it will generate the message. It would be a pretty 
poor implementation to send the message in the middle of receiving data! 

The issue is that the arrayDecode on Windows is not producing the same result 
as arrayDecode on MacOS. I really think that Monte was on to it with the way 
that arrayDecode handles binary data. 

Anyway as I mentioned in the bug report, I will probably send the files 
separately from the array to break up the payload. 

Bob S

> On Feb 20, 2025, at 9:28 PM, Mark Waddingham via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> On 2025-02-20 18:21, Bob Sneidar via use-livecode wrote:
>> Bug #24655 submitted.
> 
> Looks like an incorrect use / invalid assumption about sockets to me ;)
> 
> I've replied to the bug report but it looks like you are assuming that 
> sending X bytes in one send command from the client can be read by one read 
> command in the server...
> 
> This isn't unfortunately how things work... TCP/IP packets are only 4k 
> usually and can take a while (relatively) speaking to go from one machine to 
> the other.
> 
> The engine on either end insulates the low-level details a bit in that it has 
> a read/write queue (at the system level sockets have a sread/write data 
> buffer but only some small multiple of 4Kb) but you still need to manage data 
> size somehow.
> 
> Specifically, tell the server how much data its going to get first, and then 
> have the server read that exact amount of data.
> 
> Anyway, hopefully tweaking that will make it work for the much larger file as 
> well as the smaller one :)
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Build Amazing Things
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to