Questions tagged [capnproto]

Cap'n Proto is a zero-copy data interchange format described by a schema language not unlike Protobuf, and an associated capability-based RPC system.

Cap'n Proto is a zero-copy serialization format described by a schema language not unlike Protobuf and an associated capability-based RPC system.

99 questions
2
votes
1 answer

CapnProto maximum filesize

At the moment we are using ProtocolBuffers to exchange data between python and C++. However, we are running into the maximum filesize limitation of protocol buffers and are considering switching everything to Cap'n Proto. However, since it is…
user823255
  • 980
  • 9
  • 19
2
votes
1 answer

How to distinguish between multiple messages types in Cap'n Proto?

I'm using Cap'n proto to send and retrieve messages between multiple clients and my websocket server. Since I have only one websocket channel to send and receive data and various type of messages can be sent, I need a way to distinguish between then…
Sassa
  • 1,673
  • 2
  • 16
  • 30
2
votes
1 answer

How to set a string item of a list in capnproto C++ generated code?

I have capnproto definition like this: struct School { name @0 :Text; address @1 :Address; foundation @2 :Date; emailAddresses @3 :List(Text); } I would like to set the emailAddresses field in a builder with code similar to this (but this…
Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
2
votes
1 answer

capnpc::compile not writing files

I'm having difficulty working with the capnpc crate. I'm running Arch Linux and have installed capnp from the AUR and compiled capnpc-rust from the github project and put it in /usr/local/bin. I can manually compile the .capnp file easily with the…
hamersaw
  • 55
  • 2
  • 5
2
votes
1 answer

what is a good way to secure Cap'n Proto RPC network traffic?

I would like to use Cap'n Proto RPC to communicate with a server in the cloud from a desktop box in an office. Cap'n Proto doesn't provide secure network connections through a firewall. I would prefer c++ since I have other components which require…
James Fremen
  • 2,170
  • 2
  • 20
  • 29
2
votes
1 answer

Cap'n Proto - Finding Message Size in Java

I am using a TCP Client/Server to send Cap'n Proto messages from C++ to Java. Sometimes the receiving buffer may be overfilled or underfilled and to handle these cases we need to know the message size. When I check the size of the buffer in Java I…
BAR
  • 15,909
  • 27
  • 97
  • 185
2
votes
1 answer

Cap'n proto generated c++ source doesn't compile

I'm having trouble with this piece of capnp code: struct Result(Success, Error) { union { success @0 :Success; error @1 :Error; } } I created and compiled the c++ source like this: capnp compile -oc++ test.capnp g++ -o…
jplatte
  • 1,121
  • 11
  • 21
2
votes
2 answers

Does Cap'n Proto Support Delimited Messages

Does Cap'n Proto support delimited messages? My goal is to write multiple messages to a file pipe and read in real-time as they are being written. So... The messages need to be delimited in some way. And the parser must be able to detect incomplete…
BAR
  • 15,909
  • 27
  • 97
  • 185
2
votes
1 answer

Mutable state with Cap'n proto

How should one use Cap'n Proto for an application's mutable state similar to how Protobuf gets used? Is there a garbage collector? Kenton Varda confirmed in his comparison of Cap'n Proto, FlatBuffers, and SBE that Cap'n Proto uses arena allocators…
Jeff Burdges
  • 4,204
  • 23
  • 46
1
vote
1 answer

Convert kj::Promise to kj::Promise

I can return a kj::Exception where a kj::Promise is expected, like so: kj::Promise someFunc() { return KJ_EXCEPTION(FAILED, "some description"); } But what if I end up having a kj::Promise in a place where I don't have a…
JonasVautherin
  • 7,297
  • 6
  • 49
  • 95
1
vote
0 answers

Is there a cross-platform way to make a process based socket server in C++?

It's something that seems deceptively simple, but comes with a lot of nasty details and compatibility problems. I have some code that kinda works on Linux and... sorta works on Windows but it's having various problems, for what seems like a common…
Pepijn
  • 4,145
  • 5
  • 36
  • 64
1
vote
1 answer

How to handle capn_data in c?

I use c-capnproto to serialize my sensor data. Now I need to add a HMAC to it. It needs to be a capn_data blob, but this is not handled in the example code. When I try to add the data, it does not work. This is my capnp…
celkas
  • 21
  • 7
1
vote
1 answer

How to integrate Cap'n'Proto threads with non Cap'n'Proto threads?

How do I properly integrate Cap'n'Proto client usage with surrounding multi-threaded code? The Cap'n'Proto docs say that each Cap'n'Proto interface is single-threaded with a dedicated event loop. Additionally they recommend using Cap'n'Proto to…
Vitali
  • 3,411
  • 2
  • 24
  • 25
1
vote
1 answer

Cap'n'proto premature destruction of interface?

Let's say I have a streaming API like this: interface MyInterface { addListener @0 (listener: Listener) -> (registration: RegisteredListener); interface Listener { update @0 () -> stream; } interface RegisteredListener { } } I'm…
Vitali
  • 3,411
  • 2
  • 24
  • 25
1
vote
1 answer

Receiving zmq messages in aligned memory buffer for capnp FlatArrayMessageReader

I am sending a message over ZeroMQ PUB/SUB archetype, using a tcp:// transport-class channel, after serializing a capnp message using capnp::messageToFlatArray. On the receiving side I receive the entire content in a zmq_msg_t message. But…