[ENet-discuss] protobuf woes and serializing to string and creating a packet out of it

Jay Sprenkle jsprenkle at gmail.com
Mon Feb 11 18:40:10 PST 2013


stringstream, and the c_str() method, were designed for strings.
If there's a binary zero in the data it will not work very well.
You could convert to the textual stream or find a way to extract binary
from the protocol buffer you've created. I don't know protobuf well enough
to help you with that.
You might try stackoverflow.com if you can't figure it out.


On Mon, Feb 11, 2013 at 7:23 PM, Shaun Reich <predator106 at gmail.com> wrote:

> I'm using protobuf to send packets, I can serialize and deserialize them
> just fine in the code I link below, even if I set one of the members to 0
> (e.g. set_versionminor(0). It works fine if I serialize the contents, then
> do ss2 << ss.str(); to put that data into another buffer which i then
> deserialize..
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20130211/bff6e48f/attachment.html>


More information about the ENet-discuss mailing list