What is the difference between asio::tcp::socket's async_read_some and async_receive?

后端 未结 3 1178
天命终不由人
天命终不由人 2020-12-30 20:23

What is the difference between:

  • boost::asio::tcp::socket::async_read_some()
  • boost::asio::tcp::socket::async_receive()
  • <
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 20:49

    Their specification in the networking TR2 proposal (5.7.10.2 basic_stream_socket members) is identical too:

    On async_receive:

    Effects: Calls this->service.async_receive(this->implementation, buffers, 0, handler).

    On async_read_some:

    Effects: Calls this->service.async_receive(this->implementation, buffers, 0, handler).

    So I guess this confirms Jerry's impression.

提交回复
热议问题