使用谷物序列化和boost :: asio的示例 [英] Examples of using cereal serialization and boost::asio?

查看:118
本文介绍了使用谷物序列化和boost :: asio的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试序列化对象/消息,并将其作为UDP数据包在节点之间发送.我目前正在寻找谷物进行序列化,将boost :: asio用于实际的网络编程.有没有使用这两个库的示例,即使它们是伪代码?

I'm trying to serialize objects/messages and send them as UDP packets between nodes. I'm currently looking at cereal for serialization and boost::asio for actual network programming. Are there any examples of using these two libraries together, even if it's pseudocode?

推荐答案

您可以将任何使用Asio的Boost序列化示例视为伪代码示例.尽管存在一些差异,但Cereal足够类似于Boost序列化以使样本相关.

You can treat any example of Boost Serialization with Asio as the pseudo code example. Despite some differences, Cereal is similar enough to Boost Serialization for the samples to be relevant.

  • Straight forward: sending/receiving a struct in boost::asio
  • Backgrounds: Low bandwidth performance using boost::asio::ip::tcp::iostream
  • More choices, raw POD data: c++ Sending struct over network

这篇关于使用谷物序列化和boost :: asio的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆