I'm connecting to a websocket using the boost/beast libraries and writing the data into a beast::flat_buffer
. My issue is that I'm having trouble getting the data from buffer
. I have a thread-safe channel
object that I can to write to, but I'm not sure how to pull the most recently received message from the buffer
.
beast::flat_buffer buffer;
// send through socket
send_socket(
ws, get_subscribe_string(trade_tickers, bar_tickers, quote_tickers));
// read into buffer
while (channel.running) {
ws.read(buffer); // need to write the most recently received message into the channel
}
I can write to the channel with channel.write(std::string arg)
. Any ideas on how to pull from the buffer
?