boost中async_read和async_read_some的区别
假设原型如下
async_read(
socket_,
boost::asio::buffer(read_msg_.data(),512),
readHandler
)
和
socket_.async_read_some(
boost::asio::buffer(read_msg_.data(),512),
readHandler
)
async_read:只有读满512字节或出错才会调用readHandler,
async_read_some:只要有消息或出错就会调用readHandler