c++ – Using boost::asio::async_wait with Native recvfrom() Calls: Is It Correct?
Suppose we are waiting for incoming data on a socket using the call socket::async_wait(socket::wait_read, callback). After the callback notifies us that data is available, is it possible to read the data not via Boost.Asio, but by using the native recvfrom(socker.native_handle()) or SSL_read function, and then call async_wait again to wait for new incoming data? Is this approach correct in boost::asio? The idea is to achieve an (epoll/select)-like mechanism, but at a higher level—specifically, at the Asio abstraction level.
Other approaches are also welcome. I just need to achieve UDP socket multiplexing without using low-level epoll/select functions. But I need to read/write data using other functions, not boost ones.
Note: I’m asking about only UDP socket
Read more here: Source link
