|
Boost Users : |
Subject: Re: [Boost-users] [Asio] [Boost.ASIO] async_read cannot read full data from client
From: Sarvagya Pant (sarvagya.pant_at_[hidden])
Date: 2015-07-29 05:42:00
Hi Bjorn,
thanks for your response. While sending message from client I used \q\q as
message separator and used async_read_until using the same as message
separator. Now while client received the message as expected, the server
crashed giving the error:
**Debug Assertion Failed! Expression: string iterator not deferenceable"
Thank you.
On Wed, Jul 29, 2015 at 2:57 PM, Bjorn Reese <breese_at_[hidden]>
wrote:
> On 07/29/2015 06:28 AM, Sarvagya Pant wrote:
>
> I think in my case the buffer is not full, thus the handler function is
>> not getting called. How should I change my code so that server can read
>> the message sent by client, process it and send back correct response.?
>>
>
> It is easiest to introduce a message separator into your wire protocol.
> For instance, you could terminate each message with a newline. Then you
> can use async_read_until().
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- *Sarvagya Pant* *Kathmandu, Nepal* *+9779803468257*
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