A websocket server receives messages that need to pass to a function as an std::istream
. I am using a istringstream
as an intermediate step as:
#include <iostream>
#include <sstream> // std::istringstream, std::stringbuf
#include <string>
...
std::istringstream _iss;
std::istream &_inputbuff = _iss;
My message handler receives the message as a string and sets _iss.str(message)
.
This approach does not update the stream with the new blocks of data and as a result the next function samples only the last packet. Is there a way to append to the istringstream
instead of setting?
Thank you