【发布时间】:2012-12-14 09:50:49
【问题描述】:
我在 c++ 中有一个结构,它存储这样的字节:
struct RemoteData
{
/// some other fields here
unsigned char* buf;
int bufLen;
};
我需要通过 Thrift 将这些数据发送到用 C++ 编写的远程服务。我找到了三种将这个结构映射到 thrift idl 的方法:
-
像这样使用容器类型:
struct RemoteData { 1: list<BYTE> buf, ... } -
使用
binary输入:struct RemoteData { 1: binary buf, ... } -
在
string类型中存储数据:struct RemoteData { 1: string buf, ... }
最好的方法是什么?
【问题讨论】:
标签: thrift