How to serialize an object to send over network

前端 未结 5 1194
陌清茗
陌清茗 2021-02-15 17:42

I\'m trying to serialize objects to send over network through a socket using only STL. I\'m not finding a way to keep objects\' structure to be deserialized in the other host. I

5条回答
  •  野性不改
    2021-02-15 18:00

    I think you should use google Protocol Buffers in your project.In network transport Protocol buffers have many advantages over XML for serializing structured data. Protocol buffers:

    are simpler are 3 to 10 times smaller are 20 to 100 times faster are less ambiguous generate data access classes that are easier to use programmaticall

    and so on. I think you need read https://developers.google.com/protocol-buffers/docs/overview about protobuf

提交回复
热议问题