#pragma once
#include <trantor/exports.h>
#include <memory>
#include <trantor/net/EventLoop.h>
#include <trantor/net/InetAddress.h>
namespace trantor
{
class TRANTOR_EXPORT Resolver
{
  public:
    using Callback = std::function<void(const trantor::InetAddress&)>;
    using ResolverResultsCallback =
        std::function<void(const std::vector<trantor::InetAddress>&)>;
    static std::shared_ptr<Resolver> newResolver(EventLoop* loop = nullptr,
                                                 size_t timeout = 60);
    virtual void resolve(const std::string& hostname,
                         const Callback& callback) = 0;
    virtual void resolve(const std::string& hostname,
                         const ResolverResultsCallback& callback) = 0;
    virtual ~Resolver()
    {
    }
    static bool isCAresUsed();
};
}  