22 #ifndef NDN_NET_DNS_HPP 23 #define NDN_NET_DNS_HPP 26 #include "../util/time.hpp" 28 #include <boost/asio/ip/address.hpp> 50 return address.is_v4();
59 return address.is_v6();
63 struct Error :
public std::runtime_error
67 :
std::runtime_error(what)
93 const SuccessCallback& onSuccess,
94 const ErrorCallback& onError,
95 boost::asio::io_service& ioService,
96 const AddressSelector& addressSelector =
AnyAddress(),
97 time::nanoseconds timeout = 4_s);
112 boost::asio::io_service& ioService,
113 const AddressSelector& addressSelector =
AnyAddress());
118 #endif // NDN_NET_DNS_HPP
Error(const std::string &what)
Copyright (c) 2013-2017 Regents of the University of California.
bool operator()(const IpAddress &address) const
function< void(const IpAddress &address)> SuccessCallback
bool operator()(const IpAddress &address) const
IpAddress syncResolve(const std::string &host, boost::asio::io_service &ioService, const AddressSelector &addressSelector)
Synchronously resolve host.
function< bool(const IpAddress &address)> AddressSelector
function< void(const std::string &reason)> ErrorCallback
boost::asio::ip::address IpAddress
bool operator()(const IpAddress &address) const
void asyncResolve(const std::string &host, const SuccessCallback &onSuccess, const ErrorCallback &onError, boost::asio::io_service &ioService, const AddressSelector &addressSelector, time::nanoseconds timeout)
Asynchronously resolve host.