22 #ifndef NDN_NET_DNS_HPP 23 #define NDN_NET_DNS_HPP 25 #include "../util/time.hpp" 27 #include <boost/asio/ip/address.hpp> 56 return address.is_v4();
65 return address.is_v6();
69 struct Error :
public std::runtime_error
73 :
std::runtime_error(what)
99 const SuccessCallback& onSuccess,
100 const ErrorCallback& onError,
101 boost::asio::io_service& ioService,
102 const AddressSelector& addressSelector =
AnyAddress(),
103 time::nanoseconds timeout = time::seconds(4));
118 boost::asio::io_service& ioService,
119 const AddressSelector& addressSelector =
AnyAddress());
124 #endif // NDN_NET_DNS_HPP
Error(const std::string &what)
Copyright (c) 2013-2017 Regents of the University of California.
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
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.
boost::asio::ip::address IpAddress
bool operator()(const IpAddress &address) const