As the documentation says:
The receive() operation may not receive all the requested number of bytes. Consider using the read() function if you need to make sure that the requested amount of data is read before the lock operation completes.
If you really meant read_some() , then there is no difference. receive() is a socket-specific function, while read_some() is a common function available for all asio streams. (something like std::string length() and size() )
source share