9#include <trantor/exports.h>
11#include <trantor/net/EventLoop.h>
12#include <trantor/net/InetAddress.h>
25 using ResolverResultsCallback =
26 std::function<void(
const std::vector<trantor::InetAddress>&)>;
44 virtual void resolve(
const std::string& hostname,
45 const Callback& callback) = 0;
53 virtual void resolve(
const std::string& hostname,
54 const ResolverResultsCallback& callback) = 0;
As the name implies, this class represents an event loop that runs in a particular thread....
Definition EventLoop.h:56
Wrapper of sockaddr_in. This is an POD interface class.
Definition InetAddress.h:46
This class represents an asynchronous DNS resolver.
Definition Resolver.h:22
static bool isCAresUsed()
Check whether the c-ares library is used.
virtual void resolve(const std::string &hostname, const Callback &callback)=0
Resolve an address asynchronously.
static std::shared_ptr< Resolver > newResolver(EventLoop *loop=nullptr, size_t timeout=60)
Create a new DNS resolver.
virtual void resolve(const std::string &hostname, const ResolverResultsCallback &callback)=0
Resolve an address array asynchronously.
Definition EventLoop.h:34