Discussion:
[capnproto] Bytestream layer.
studi
2018-03-11 05:30:47 UTC
Permalink
Cap'n Proto is on top a bytestream layer.

I want to send Cap's proto data on top of encrypted UDT streams. (Which
are not exactly streams since they reliably transmit arbitrary length
records, rather than an arbitrary stream of sequential bytes,
necessitating ciphertext stealing when a record is not a multiple of
sixteen bytes)

I suppose this is probably documented in some glaringly obvious place,
or should be self evident, but how do I arrange that Cap'n proto uses my
streams - how do I hook the output from Cap'n proto and supply it with
input?
--
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 capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Kenton Varda
2018-03-11 17:28:42 UTC
Permalink
Post by studi
Cap'n Proto is on top a bytestream layer.
Not really. There are utilities for reading from / writing to a byte
stream, but Cap'n Proto is not fundamentally tied to byte streams. In fact,
Cap'n Proto is commonly used on top of mmap(), which is definitely not a
byte stream.

I want to send Cap's proto data on top of encrypted UDT streams. (Which are
Post by studi
not exactly streams since they reliably transmit arbitrary length records,
rather than an arbitrary stream of sequential bytes, necessitating
ciphertext stealing when a record is not a multiple of sixteen bytes)
I suppose this is probably documented in some glaringly obvious place, or
should be self evident, but how do I arrange that Cap'n proto uses my
streams - how do I hook the output from Cap'n proto and supply it with
input?
Are you talking about the base Cap'n Proto serialization, or the RPC
protocol?

For the base serialization (assuming C++):
MessageBuilder::getSegmentsForOutput() returns an array of arrays pointing
to the segments of the message (does not do a copy; returns pointers
directly into the existing underlying memory). Do whatever you want with
them. On the receiving end, use SegmentArrayMessageReader to take an
array-of-arrays and read messages from them (again, with no copies).

If you want to implement an alternative RPC transport, you need to write
your own implementation of capnp::VatNetwork (defined in capnp/rpc.h).

-Kenton
--
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 capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
studi
2018-03-13 07:26:03 UTC
Permalink
Post by Kenton Varda
MessageBuilder::getSegmentsForOutput() returns an array of arrays
pointing to the segments of the message (does not do a copy; returns
pointers directly into the existing underlying memory). Do whatever
you want with them. On the receiving end, use
SegmentArrayMessageReader to take an array-of-arrays and read messages
from them (again, with no copies).
If you want to implement an alternative RPC transport, you need to
write your own implementation of capnp::VatNetwork (defined in
capnp/rpc.h).
Thanks, this answers my question
--
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 capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Loading...