<div dir="ltr">On Mon, Feb 11, 2013 at 9:40 PM, Jay Sprenkle <span dir="ltr"><<a href="mailto:jsprenkle@gmail.com" target="_blank">jsprenkle@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">stringstream, and the c_str() method, were designed for strings.<br>

If there's a binary zero in the data it will not work very well.<br>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.<br>


You might try <a href="http://stackoverflow.com" target="_blank">stackoverflow.com</a> if you can't figure it out.</blockquote><div><br></div><div style>yep, you're absolutely right. i fixed it by doing  std::stringstream ss2(std::string(packet->data, packet->dataLength)); and ENetPacket *packet = enet_packet_create(ss.str().data(), ss.str().size(), ENET_PACKET_FLAG_RELIABLE);</div>

<div style><br></div><div style>which should be useful for anyone else who might encounter this.</div><div style><br></div><div style>thanks for the fast response & help</div></div><br></div></div>