The object is essentially BYTE
s of dynamic length.
What's the easiest way to implement a send/receive mechanism?
I got a tip follows but have no idea how to roll this protocol myself:
Just remember that pipes, like sockets, don't guarantee that everything you put in the pipe will come out the other end in the same number of reads as there were writes. When you read from the pipe or socket you are given what is currently available in the buffer which may not yet be everything that was written so you have to keep reading until you get the expected amount of data.