How to send large objects using boost::asio

Posted by Max on Stack Overflow See other posts from Stack Overflow or by Max
Published on 2010-05-07T14:47:57Z Indexed on 2010/05/10 20:54 UTC
Read the original article Hit count: 356

Filed under:
|
|
|
|

Good day.

I'm receiving a large objects via the net using boost::asio.

And I have a code:

for (int i = 1; i <= num_packets; i++)
 boost::asio::async_read(socket_, boost::asio::buffer(Obj + packet_size * (i - 1), packet_size), boost::bind(...));

Where My_Class * Obj. I'm in doubt if that approach possible (because i have a pointer to an object here)? Or how it would be better to receive this object using packets of fixed size in bytes?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about boost

Related posts about large-data