|
Boost Users : |
Subject: Re: [Boost-users] [asio] sending and receiving binary
From: Wilde, Donald S (donald.s.wilde_at_[hidden])
Date: 2011-07-09 18:59:06
> > 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) {...}.
Hmm...thought I was. :)
> > ... 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.
Ah, the other version did, but this one doesn't. I misunderstood and thought HandleWrite was only bound to the error occurrence. I only want the connection to live through one send and one reply, but if I understand you correctly I have to beg it to stay alive long enough for the reply to go out?
Okay, thanks for your patience, Igor! :D
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net