On Mon, Feb 11, 2013 at 9:40 PM, Jay Sprenkle <[email protected]> wrote:

> 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.


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);

which should be useful for anyone else who might encounter this.

thanks for the fast response & help
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to