Hi Ricardo,
 
IIUC, it's bad idea to call async_write before the previous call to async_write is completed (the same is true for async_read), since it's not guaranteed the "parallel" async_write's/read's are dispatched in the order you wish. The correct flow would be to call next async_write in the writeHandler. You can find lots of examples in ASIO tutorial.






> To: boost-users@lists.boost.org
> From: gumbeto@gmail.com
> Date: Mon, 12 May 2008 19:26:39 +0100
> Subject: [Boost-users] [asio] async_write and callback order
>
> Hi all,
>
> I tried to clarify this on the irc but no one was sure about it:
> - when calling async_write multiple times, is there any guarantee
> that the handle_write callback I pass is called in the same order?
> <...>
> Ricardo
>



Explore the seven wonders of the world Learn more!