[protobuf] message type

2013-03-21 Thread Ke Wang
Hi everyone, I am new to google protocol buffer. I am wondering if I can define linked list message type, below is the data structure I want: 14 typedef struct _linked_item 15 { 16 void *data; 17 struct _linked_item *next; 18 } linked_item; 19 20 typedef struct _linked_list 21

[protobuf] Google Protocol Buffer C bindings problem

2013-04-05 Thread Ke Wang
Hi all, I used the c bindings of Google protocol buffer, when use the get packed size method, it gave me assertion failed problem. The kvstr.proto file: message KVStr { optional int32 job_id = 1; optional int32 num_item = 2; repeated string name = 3; } I generated the head file and

[protobuf] Serialization problem with repeated nested filed sending through a socket

2014-03-11 Thread Ke Wang
Hi all, I am using google protocol buffer to transmit complex data structures over socket. Here is the .proto file: message MatrixMsg { required string msgType = 1; optional int64 count = 2; optional string extraInfo = 3; message TaskMsg { required string taskId = 1; required string user = 2;

Re: [protobuf] Serialization problem with repeated nested filed sending through a socket

2014-03-12 Thread Ke Wang
5:28:50 AM UTC-5, Ilia Mirkin wrote: On Tue, Mar 11, 2014 at 11:09 PM, Ke Wang kewa...@gmail.com javascript: wrote: Hi all, I am using google protocol buffer to transmit complex data structures over socket. Here is the .proto file: message MatrixMsg { required string

Re: [protobuf] Serialization problem with repeated nested filed sending through a socket

2014-03-12 Thread Ke Wang
Mirkin wrote: On Wed, Mar 12, 2014 at 9:48 AM, Ke Wang kewa...@gmail.com javascript: wrote: Thanks, but when I print out the char* using string.data(), it got truncated too. Right... most print functions will stop when they see a null character... you can't use printf/cout/etc