Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] async_read and 100% CPU
From: Igor R (boost.lists_at_[hidden])
Date: 2009-06-30 16:48:53


>> What is contained inside your buffer object?  If your buffer has a
>> size of 0, then this seems like it would cause the problem.
>>
> yip, it has a size of 0. I hoped that the async receive would just increase
> the size of the vector as it puts the contents into it, but that is not
> happening.

The function you use reads an amount of data that is less or equal
than your buffer size. I.e. zero.
If you want to get your buffer expanding automatically, you might be
interested in this function (in conjunction with asio::streambuf) :
http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/async_read/overload3.html


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