25 Sep
2009
25 Sep
'09
4:14 p.m.
OvermindDL1 wrote:
On Fri, Sep 25, 2009 at 4:56 AM, pedro chaparro
wrote: hi, i'm wondreing if using asio library can i send a structure and not just string messages using the boost::asiio:write command? or how could i do to send a structure which have many information fields? thanks
As long as it is a POD without pointers, just give it the pointer to the beginning of it and the size. If it is not POD and/or has pointers, then send each element individually.
Or use Boost.Serialization to serialize your struct/class to a text archive and stream that with asio.