I've got a project where I need to send AMF3 serialized
objects (binary data) Socket (the binary kind). I'm confident that
I'll be able to get the objects serialized one way or another, but
I'm wondering how to deal with repeated onSocketData events being
triggered during the transmission of a very large serialized
object. For instance, receiving a 1,000,000 byte object over socket
results in my onSocketData function being triggered a few dozen
times using the attached code:
Here's the output:
constructor
socket connected
socket bytes available:1460
socket bytes available:8760
socket bytes available:17520
.
.etc.
.
socket bytes available:934400
socket bytes available:978200
socket bytes available:986960
socket bytes available:1036600
In the applications I'm working on, a second message could
have arrived while the first one was still being received and there
isn't really any way to delimit them is there? I can't think of any
sequence of bytes which would properly serve as a delimiter.