I have found many examples showing how to copy the contents of a boost::beast::multi_buffer to a string, but how do I assign the contents of a string to a multi_buffer that has previously been created in a class instance?
If I have the example declarations in my class:
private:
boost::beast::websocket::stream<boost::asio::ip::tcp::socket> ws_;
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
boost::beast::multi_buffer buffer_;
how do I assign a string to buffer_ before using it in a call to:
ws_.async_write(buffer_.data(), boost::asio::bind_executor(strand_,
std::bind(&CNXG_session::on_write,
shared_from_this(),
std::placeholders::_1,
std::placeholders::_2)));