There are two types of reading-from-stream functions for boost::asio::ip::tcp::socket
. I am assuming they their semantics vary. Could someone please outline them, the documentation I have looked through does not clarrify this.
As it says in the documentation:
The
receive()
operation may not receive all of the requested number of bytes. Consider using theread()
function if you need to ensure that the requested amount of data is read before the blocking operation completes.
If you actually meant read_some()
, then there is no difference. receive()
is the socket-specific function, whereas read_some()
is the generic function available for all asio streams. (much like std::string
's length()
and size()
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With