Параллельный запуск преобразователя Boost Beast для нескольких URL-адресов ⇐ C++
-
Гость
Параллельный запуск преобразователя Boost Beast для нескольких URL-адресов
I was wondering that if we run multiple calls of async_resolve than in practice the io_context doesn't run more than one request at the time due to a known limitation.
Here's a sample example where I'd expect that each resolve request will yield while it wait for the dns response to return, and move to the next request and so on.
but from looking at Wireshark it looks like the next resolve is performed only after the previous one finishes.
boost::asio::ip::tcp::resolver resolver(io_ctx_); const auto results1 = resolver.async_resolve(host1_, std::to_string(port1_), yield); const auto results2 = resolver.async_resolve(host2_, std::to_string(port2_), yield); const auto results3 = resolver.async_resolve(host3_, std::to_string(port3_), yield); Does io_context handle only one resolve request at a time ?
Источник: https://stackoverflow.com/questions/781 ... n-parallel
I was wondering that if we run multiple calls of async_resolve than in practice the io_context doesn't run more than one request at the time due to a known limitation.
Here's a sample example where I'd expect that each resolve request will yield while it wait for the dns response to return, and move to the next request and so on.
but from looking at Wireshark it looks like the next resolve is performed only after the previous one finishes.
boost::asio::ip::tcp::resolver resolver(io_ctx_); const auto results1 = resolver.async_resolve(host1_, std::to_string(port1_), yield); const auto results2 = resolver.async_resolve(host2_, std::to_string(port2_), yield); const auto results3 = resolver.async_resolve(host3_, std::to_string(port3_), yield); Does io_context handle only one resolve request at a time ?
Источник: https://stackoverflow.com/questions/781 ... n-parallel
Мобильная версия