Serialize C++ object to send via sockets to Python - best approach?

后端 未结 2 1419
有刺的猬
有刺的猬 2021-02-04 19:56

I need to create a network communication between two different frameworks, one written in C++ and the other in Python.

To exchange data, I want

2条回答
  •  野性不改
    2021-02-04 20:31

    Go for Protocol Buffers - Google Code which has enough resource for c++ and python. You can make a compatible structure which is readable in both languages.

    Protocol Buffers are a method of serializing structured data. As such, they are useful in developing programs to communicate with each other over a wire or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates from that description source code in various programming languages for generating or parsing a stream of bytes that represents the structured data. †

提交回复
热议问题