[protobuf] sending a message over TCP from a C++ client to a Java server

2010-10-13 Thread Paul
Hi, I am new to protocol buffers, and I am trying to send a protocol buffers message over TCP from a client computer running C++ to a server computer running Java. Both computers are 64 bit. On the server side (in Java), I open a ServerSocket on a port, and get a Socket after accepting the clien

Re: [protobuf] sending a message over TCP from a C++ client to a Java server

2010-10-13 Thread Evan Jones
On Oct 13, 2010, at 15:13 , Paul wrote: On the client side (in C++), I open a TCP socket connection on the same port with the server's IP address. I serialize the message using SerializeToCodedStream into an array using ArrayOutputStream. After serializing it, I send it over the TCP connection

[protobuf] Re: sending a message over TCP from a C++ client to a Java server

2010-10-13 Thread Paul
Thanks for the suggestion. However, I am already prepending the message size on the C++ side in the line: coded_output->WriteVarint64(snap1.ByteSize()); is there anything else that stands out to you? thanks for any further help. On Oct 13, 12:56 pm, Evan Jones wrote: > On Oct 13, 2010, at 15:1

[protobuf] valgrind invalid write and double free errors

2010-10-13 Thread CB
I've been using protobuf 2.3.0 for several weeks, using SerializeToString. The other day, I switched to using SerializeToOstream, and started seeing the following invalid write and double free errors reported by valgrind when my program is terminated; ==15778== Invalid write of size 4 ==15778==

Re: [protobuf] Re: sending a message over TCP from a C++ client to a Java server

2010-10-13 Thread Evan Jones
On Oct 13, 2010, at 16:49 , Paul wrote: Thanks for the suggestion. However, I am already prepending the message size on the C++ side in the line: coded_output->WriteVarint64(snap1.ByteSize()); You may want to verify that the exact bytes that come out of msg.SerializeToString (or related) are

Re: [protobuf] valgrind invalid write and double free errors

2010-10-13 Thread Evan Jones
On Oct 13, 2010, at 16:53 , CB wrote: Any feedback on how to further debug this problem would be appreciated. You aren't doing anything strange like using dlopen() to dynamically load/unload libraries, are you? I can't think of anything obvious that might cause this kind of error. The FileD

[protobuf] Re: sending a message over TCP from a C++ client to a Java server

2010-10-13 Thread Paul
ok thanks a lot! I ended up finding that my TCP send function was not set up correctly. Once that was fixed, it worked fine. Thanks! On Oct 13, 2:20 pm, Evan Jones wrote: > On Oct 13, 2010, at 16:49 , Paul wrote: > > > Thanks for the suggestion.  However, I am already prepending the > > messag