Serialization is controlled by specializations of SerializationTraits [1].
There is a built-in one for the grpc::ByteBuffer type [2].
So, using something like grpc::ServerAsyncResponseWriter<grpc::ByteBuffer>
or grpc::ServerWriteReactor<grpc::ByteBuffer> should already work if you can
use grpc::ByteBuffer as your buffer type.
Note: the ProtoBuf codegen writes a lot of the glue code to register
"handler" code for the various methods that you want to expose. If you want
to use raw byte buffers, you'll need to write this code yourself. It's been
a while since I looked at what protoc generates. I'd start by running
codegen on the helloworld.proto file and looking at what it emits for the
the Greeter::AsyncService and Greeter::CallbackService base classes.
I've also not used the callback/reactor model in C++, only the
"async"/completion queue model. I _assume_ the callback/reactor model uses
SerializationTraits as well.
--
Christopher Warrington
Microsoft Corp.