
9 Jul
2011
9 Jul
'11
9:59 p.m.
It appears to be accepting the message, but when it tries to respond the async_write() function throws an error:
ERROR: 'system:0' has occurred.
It means there's no error. Test error_code like this: if (aError) {...}.
... and I see 'connection reset by peer' on the client side.
Your HandleWrite doesn't initiate another i/o operation, doesn't create another handler bound to shared_from_this, so the TCPConnection instance gets destroyed along with its socket.