# flatbuffer_sample **Repository Path**: shzhxh/flatbuffer_sample ## Basic Information - **Project Name**: flatbuffer_sample - **Description**: C++与Python通过flatbutter传输的例子 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-04-21 - **Last Updated**: 2024-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # flatbuffer_sample #### 介绍 C++与Python通过flatbutter传输的例子 #### 使用说明 ```bash cd samples # 所有程序都在samples目录下运行 ./mkcpp.sh # 编译cpp示例程序:cpp_A和cpp_B # c++与python通过网络传输flatbuffer ./cpp_A # c++程序作为服务器 python python_B.py # 新开一个窗口,运行此命令。python程序作为客户端。 # python与c++通过网络传输flatbuffer python python_A.py # python程序作为服务器 ./cpp_B # 新开一个窗口,运行此命令。c++程序作为客户端。 ``` #### 编译flatc ```bash # 编译flatc git clone https://github.com/google/flatbuffers.git export CC=/usr/bin/clang export CXX=/usr/bin/clang++ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -B build cd build && make ``` #### 关于flatbuffers的文档 - [writing a schema](https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html) - [grammar of the schema language](https://google.github.io/flatbuffers/flatbuffers_grammar.html) - [tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) - [use cpp](https://google.github.io/flatbuffers/flatbuffers_guide_use_cpp.html) - [api](https://google.github.io/flatbuffers/group__flatbuffers__cpp__api.html) - [use python](https://google.github.io/flatbuffers/flatbuffers_guide_use_python.html)