jeudi 13 août 2015

Boost ASIO streambuf

I am confused about the input sequence and output sequence in boost asio::streambuf classes.

According to the code examples (for sending data) in the documentation it seems that the buffer representing the input sequence is used for writting to socket and the one representing the output sequence is used for reading.

Example -

boost::asio::streambuf b;
std::ostream os(&b);
os << "Hello, World!\n";
// try sending some data in input sequence
size_t n = sock.send(b.data());
b.consume(n); // sent data is removed from input sequence

Now, is there a nomenclature problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire