How can I flush data from streambuf to file?
I’ve tried
read(*socket_, streamBuf, boost::asio::transfer_at_least(694784))
std::istream is(&streamBuf);
std::ofstream outfile;
outfile.open ("test.exe");
is >> outfile;
outfile.close()
but that didn’t work.
Any clue how to do that?
You might try a
buffer_cast. Here is an example: