Boost logo

Boost Users :

Subject: Re: [Boost-users] sending struct of int from Linux to Windows using boost::asio
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2009-09-10 01:39:44


A.Agrawal_at_[hidden] wrote:

[snip]
> buffers.push_back(boost::asio::buffer((_data_serialized).c_str(),
> _data_serialized.length()));
[snip]

I haven't read all of your code, but I don't think .c_str() will have an
object lifetime that exceeds the asynchronous operation. There's support for
std::string, you could try

buffers.push_back(boost::asio::buffer(_data_serialized));

Have you verified that on your platform sizeof(MessageHeader) equals what
you have set for it?

Kind regards,

Rutger ter Borg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net