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

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/f936dc9e-95a4-4430-b4bf-038ecd7d6ff9n%40googlegroups.com.

Reply via email to