76 boost::asio::io_context io_context;
77 boost::asio::ip::tcp::resolver resolver(io_context);
78 boost::asio::ip::tcp::resolver::query query(boost::asio::ip::tcp::v4(), address,
"", boost::asio::ip::tcp::resolver::query::canonical_name);
79 boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query);
80 boost::asio::ip::tcp::resolver::iterator end;
83 boost::asio::ip::tcp::endpoint endpoint = *iter++;
84 return endpoint.address();
86 return boost::asio::ip::make_address(address);