读书人

protobuf解决方法

发布时间: 2013-06-26 14:29:32 作者: rapoo

protobuf
message Person {
required int32 id=1;
required string name=2;
extensions 3 to max;
}

中的required 是什么意思 protobuf c
[解决办法]
表示是一个必须字段,必须相对于发送方,在发送消息之前必须设置该字段的值,对于接收方,必须能够识别该字段的意思。发送之前没有设置required字段或者无法识别required字段都会引发编解码异常,导致消息被丢弃。

读书人网 >C语言

热点推荐