
Controlling the streambuf's lifetime with a shared pointer is probably an error. The buffer will need to live as long as the socket lives. It will contain extra data after each async_read which you will want to preserve. I would suggest that it's a member owned by the connection object, in the same way that the socket is On Sun, 6 Jan 2019, 09:08 hh h via Boost <boost@lists.boost.org wrote:
Thanks Richard, that was well explained, I am now thinking to have a class to wrap the shared_ptr<boost::asion::streambuf> to lock it down during calling the async_xxx until it is back to the handler function then to release it.
Thank you so much Richard.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost