Hi,

I've read the CQL wire specification and naively, I can't see how the frame
length length header is used.

To me, it looks like on the read side, you know which type of structures to
expect based on the opcode and each structure is TLV encoded.

On the write side, you need to encode TLV structures as well, but you don't
know the overall frame length until you've encoded it. So it would seem
that you either need to pre-calculate the cumulative TLV size before you
serialize the frame body, or you serialize the frame body to a buffer which
you can then get the size of and then write to the socket, after having
first written the count out.

Is there potentially an implicit assumption that the reader will want to
pre-buffer the entire frame before decoding it?

Cheers,

Ben

Reply via email to