The way I used and saw asio :: streambuf is usually used with std :: ostream or std :: istream, something like:
boost::asio::streambuf Stream; std::ostream os(&Stream); int SetValue = 0xaabbccdd; os.write(reinterpret_cast<const char*>(&SetValue), sizeof(SetValue));
I'm not sure why your code does not work, but if it works above, then some difference may appear through it compared to your code. Also, on which line does it fall?
Guy sirton
source share