tags:

views:

100

answers:

0

I'm trying to receive many udp messages from one async_receive call. My messages are approx. 60 bytes long.

I'm giving an async_receive call a buffer array very similar to the boost docs but can't seem to get all the buffers filled.

char d1[128]; char d2[128]; char d3[128];

boost::array bufs = { boost::asio::buffer(d1), boost::asio::buffer(d2), boost::asio::buffer(d3) };

_socket.async_receive(bufs, handler);

When my handler gets called the bytes_transferred is equal to one message length (i.e. 60).

Any thoughts on how I can get the second and third buffer populated? Also, how do I now if the second and third mutable buffer were populated?

Thanks ahead of time.