2

I am using Boost.Asio, I want to improve my system by using Zero-copy sendmsg/Receive. Can I use Zero-copy sendmsg/Receive in Boost.Asio? Could you give me how to use them if I can use them?

masshuroom
  • 53
  • 1
  • 6
  • This question is a duplicate of several mentioned in an answer below, but it is certainly not unfocused, except maybe to those who just don't know anything about the topic. – user207421 Feb 17 '20 at 00:25

1 Answers1

3

Short answer, you can only if your in-memory representation is identical to the on-the-wire one.

See the answers here, which do an excellent job of describing how e.g. Cap'n Proto achieves this:

Also compare:

And on creating memory-mappable representations of advanced C++ data structures so that they can be mapped on-the-wire:

sehe
  • 374,641
  • 47
  • 450
  • 633