Boost logo

Boost :

From: Jupiter (jupiter.hce_at_[hidden])
Date: 2020-06-10 06:12:20


Sorry, this is really a silly question, but I could not find a clear
API in streambuf reference, I have following code to call PacketData
in a loop, the buffer.get() looked to accumulate previous data in the
buffer, so I should call buffer.clear() before calling buffer.get(),
but apparently there no ‘clear’ in boost::asio::basic_streambuf.

PacketData(const msgpack::sbuffer &sb, boost::asio::streambuf &buffer)) {
.......
std::ostream os(buffer.get());
os.write((char *)&header, sizeof(header));
os.write((char *)sb.data(), sb.size());
.......
}

Thank you.

Kind regards,

- jh

-- 
"A man can fail many times, but he isn't a failure until he begins to
blame somebody else."
-- John Burroughs

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk