|
Boost Users : |
Subject: Re: [Boost-users] Buffering and ASIO
From: Scott Gifford (sgifford_at_[hidden])
Date: 2008-12-12 17:57:44
"Vadim Shmelev" <vadim.shmelev_at_[hidden]> writes:
[...]
> Now I want to read all video data in one function call, for example:
>
> boost::asio::async_read(m_socket, boost::asio::buffer(pSample->GetBody(),
> m_currentSampleLength),boost::bind(&CAXISParser::read_body, this, pSample,
> boost::asio::placeholders::error,
> boost::asio::placeholders::bytes_transferred));
>
> , where pSample is object with buffer for video data. There is problem that
> async_read_until captures some data from video data, and that call's behavior
> is incorrect. How can i fight that problem? For example, how can i figure out
> number of bytes left in streambuf and copy them to my buffer, and
> then read rest with async_read? I'm will very appreciate for any advices.
Hello Vadim,
It's not clear to me exactly what you're asking here. From what I can
tell, you have created a buffer of size m_currentSampleLength, and
asked ASIO to call CAXISParser::read_body when it has received this
many bytes. Is that what you intended to do? Is that what boost is
doing? Or is the problem something else?
-----Scott.
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