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

2014-03-12 Thread Ilia Mirkin
On Tue, Mar 11, 2014 at 11:09 PM, Ke Wang kewang...@gmail.com 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 msgType = 1; optional int64 count = 2; optional string extraInfo =

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

2014-03-12 Thread Ke Wang
Thanks, but when I print out the char* using string.data(), it got truncated too. Later, I need to transfer this char* through TCP socket, which apparently cannot be decoded right at the server side. Did I do something wrong with the definition of the message? Ke On Wednesday, March 12, 2014

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

2014-03-12 Thread Ilia Mirkin
On Wed, Mar 12, 2014 at 9:48 AM, Ke Wang kewang...@gmail.com 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 -- you'd have to write a custom print

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

2014-03-12 Thread Ke Wang
OK, Thanks. Let me post my code here a little bit: message MatrixMsg { required string msgType = 1; optional int64 count = 2; optional string extraInfo = 3; message TaskMsg { required string taskId = 1; required string user = 2; required string dir = 3; required string cmd = 4; required int64

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

2014-03-12 Thread Ilia Mirkin
On inspection, your code seems fine. (Why you bother to create a mmChar instead of just passing mmStr.data(), mmStr.length() to send is unclear to me, but I'm guessing you're trying to replicate the larger codebase.) It's been long enough that I don't remember off-hand if send() is guaranteed to

[protobuf] Issue 614 in protobuf: ByteString: Method For Chunking

2014-03-12 Thread protobuf
Status: New Owner: liuj...@google.com Labels: Type-Defect Priority-Medium New issue 614 by vi...@umich.edu: ByteString: Method For Chunking http://code.google.com/p/protobuf/issues/detail?id=614 The internal usage of RopeByteString (and RopeInputStream) is particularly interesting. Alongside

[protobuf] Issue 615 in protobuf: misleading document in python api

2014-03-12 Thread protobuf
Status: New Owner: Labels: Type-Defect Priority-Medium New issue 615 by ccpp...@gmail.com: misleading document in python api http://code.google.com/p/protobuf/issues/detail?id=615 The document for python api ParseFromString is misleading as following: def ParseFromString(self,