Thanks Bjorn, I have solved the problem by making a shared pointer inside tcp_connection class **boost::shared_ptr<std::string> messageSend;** . While the server now works fine, but for the client created by me, the client received gets correct response the first time but it will not get response afterwards and gives error **system:10053 receive: An established connection was aborted by the software in your host machine**
The client will attempt to connect to socket and kept on loop forever to communicate with client. Doesn't the boost keep reference of current alive connection? Please correct me.
Thanks.

On Wed, Jul 29, 2015 at 5:59 PM, Bjorn Reese <breese@mail1.stofanet.dk> wrote:
On 07/29/2015 11:42 AM, Sarvagya Pant wrote:

separator. Now while client received the message as expected, the server
crashed giving the error:

**Debug Assertion Failed! Expression: string iterator not deferenceable"

This is likely due to your messageTemp variables. When you pass a buffer
to async_write, then you must make sure that it exits until the write
operation is done.


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



--
Sarvagya Pant
Kathmandu, Nepal
+9779803468257