$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
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