I've scoured the net for a solid example of using capnp purely as a data interchange format sans RPC, streaming over TCP and dont see it. I like the design concept of capnp vs competitors and I want to use it in place of ASN.1 generated code for a project.
However, the documentation is just so scattered and unclear that I can't get a basic test structure sucessfully sent to a python process.
I've implemented my own simple framing, consisting of a 4 byte length that c++ sends to python before the message. I compute the payload length as computeSerializedSizeInWords() * sizeof(capnp::word) and then send it, using an kj::OutputStream subclass that sends the data via ASIO.
My python process reads the length and payload, but when I try to create the message with
message_capnp.Message.read(socket) I get a message has too many segments error.
I have read that vague bit in the Encoding | Serialization Over a Stream section of the home page docs and I cannot tell if that is saying I need to implement that on both sides of the wire, or if capnp::writeMessage() implements that.
Is there some documentation that I'm missing? Seems strange that such a common use case would be effectively undocumented! Is use as a pure data-interchange format discouraged?
rjo