Files
rk35xx-android14/external/flatbuffers/docs/source/gRPC/CppUsage.md
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

775 B

Use in C++

Before you get started

Before diving into the FlatBuffers gRPC usage in C++, you should already be familiar with the following:

  • FlatBuffers as a serialization format
  • gRPC usage

Using the FlatBuffers gRPC C++ library

NOTE: The examples below are also in the grpc/samples/greeter directory.

We will illustrate usage with the following schema:

@include grpc/samples/greeter/greeter.fbs

When we run flatc, we pass in the --grpc option and generage an additional greeter.grpc.fb.h and greeter.grpc.fb.cc.

Example server code looks like this:

@include grpc/samples/greeter/server.cpp

Example client code looks like this:

@include grpc/samples/greeter/client.cpp