|
Boost Users : |
Subject: Re: [Boost-users] Cannot get boost::asio::read_until to properly read a line. [new to boost/asio]
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2015-11-04 18:12:17
Mere moments ago, quoth I:
> Secondly, note that read_until may (and usually does) read data beyond
> the delimiter into the buffer. It is therefore essential to preserve
> this buffer between calls (ie. don't make it a local variable), and to
> properly mark the bytes that you are extracting from it as consumed so
> that you don't keep getting the same line again.
To clarify, std::getline does consume the bytes. If you were using some
other method to extract data from the streambuf then you might need to
do something more explicit.
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