Select functionality in boost::asio

后端 未结 3 443
暖寄归人
暖寄归人 2021-01-11 10:56

I am going to use boost::asio lib for my project. But it\'s not quite obvious which function is corresponding to select() from native socket C lib. Is that avai

3条回答
  •  星月不相逢
    2021-01-11 11:23

    The documentation has a specific section for mapping the BSD socket API calls into their respective Asio equivalent

    poll(), select(), pselect()

    io_service::run(), io_service::run_one(), io_service::poll(), io_service::poll_one()

    Note: in conjunction with asynchronous operations.

    Note that there are subtle differences between each of these io_service methods, picking the correct one will depend on your application design.

提交回复
热议问题