#pragma once

#include "async_simple_wrapper_i.h"


namespace NSrvKernel::NDns {

class TAsyncSimpleWrapper final : public IAsyncSimpleWrapper {
public:
    TAsyncSimpleWrapper(TDuration timeout);
    ~TAsyncSimpleWrapper() override;

    void AsyncResolve(const char* addr, int family, IHostResult* cb) noexcept override;
    void CancelRequests() noexcept override;
    void WaitRequests(TDuration timeout) noexcept override;

private:
    static void ResolveHostCbInternal(void *arg, int status, int timeouts, hostent *he) noexcept;

private:
    ares_channel Channel_;
};

}