22 #ifndef NDN_NET_DNS_HPP 23 #define NDN_NET_DNS_HPP 28 #include <boost/asio/ip/address.hpp> 50 return address.is_v4();
59 return address.is_v6();
63 class Error :
public std::runtime_error
66 using std::runtime_error::runtime_error;
90 const SuccessCallback& onSuccess,
91 const ErrorCallback& onError,
92 boost::asio::io_service& ioService,
93 const AddressSelector& addressSelector =
AnyAddress(),
94 time::nanoseconds timeout = 4_s);
109 boost::asio::io_service& ioService,
110 const AddressSelector& addressSelector =
AnyAddress());
115 #endif // NDN_NET_DNS_HPP
function< void(const IpAddress &address)> SuccessCallback
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
bool operator()(const IpAddress &address) const
boost::asio::ip::address IpAddress
bool operator()(const IpAddress &address) const
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.