6 std::vector<boost::asio::ip::udp::endpoint>
resolve(boost::asio::io_service& io_service,
7 const std::string& host,
uint16_t port)
9 using q = boost::asio::ip::udp::resolver::query;
10 using b = boost::asio::ip::resolver_query_base;
11 boost::asio::ip::udp::resolver res(io_service);
12 boost::system::error_code ec;
13 auto ep = res.resolve(q(host, std::to_string(
uint64_t(port)),
14 b::address_configured | b::numeric_service), ec);
17 std::vector<boost::asio::ip::udp::endpoint> eps;
18 while(ep != boost::asio::ip::udp::resolver::iterator())
20 if(ep->endpoint().address().is_v4())
30 "name resolution failed: ${reason}",
31 (
"reason", ec.message()));