适合socket流的C++/Java序列化库? [英] C++/Java serialization library suitable for socket stream?

查看:38
本文介绍了适合socket流的C++/Java序列化库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用 C++/Obj-C 编写一个服务器,它可以从几个用 Java 和 C++ 构建的客户端接收流数据.挑战:我需要有效地序列化和反序列化数据结构.一个 C++ 客户端将生成 128x96x2 维浮点数组,加上一些元数据,每秒大约 30 次(视频功能).Java 客户端将生成一个较小的特征向量——可能是 200 个值,每秒 1-10 次.我已准备好自行实施,但在此之前,我想请教一下建议.

I need to write a server in C++/Obj-C that can receive streamed data from several clients built in Java and C++. The challenge: I need to serialize and deserialize the data structures efficiently. One C++ client will be generating 128x96x2-dimensional float arrays, plus some metadata, about 30 times per second (video features). A Java client will be generating a smaller feature vector -- probably 200 values, 1-10 times per second. I've about resigned myself to rolling my own implementation, but before I do, I'd like to ask recommendations.

推荐答案

Google 协议缓冲区支持您所需的语言和序列化数据结构的流,但我不确定您将如何最好地处理这些大型数组.这里在 Java protobuf 的这个领域有一些正在进行的工作- 背景此处.

Google Protocol Buffers supports your required languages and streaming of serialized data structures, but I am not sure how you would best handle those large arrays. There is some ongoing work here in this area of protobuf for Java - background here.

考虑到这一点,您可能能够使用 Java 和 C++ protobuf 生成一些工作,并使用 C++ 中的自定义代码来处理该分支中的 Java 数组编码.

With this in mind, you might be able to produce something that works using Java and C++ protobuf, with custom code in C++ to handle the Java array encoding in that branch.

这篇关于适合socket流的C++/Java序列化库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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