Re: [capnproto] Server process stops accepting connections

2022-12-05 Thread 'Kenton Varda' via Cap'n Proto
Hi Jens, Sorry for the slow reply, I've been on leave. In general, KJ async I/O objects are tied to the thread / event loop where they were created. This means you cannot pass an AsyncIoStream between threads. You can, however, pass a file descriptor. If you are careful, you could tear down the

Re: [capnproto] capnp::messageToFlatArray to pre-allocated buffer?

2022-12-05 Thread 'Kenton Varda' via Cap'n Proto
Hi Hui, Sorry for the slow reply, I was on leave. messageToFlatArray() is a convenience function for when you don't mind allocation and copying. If you want more control over serialization, you can use MessageBuilder::getSegmentsForOutput() to get direct pointers to the message's underlying