From 0ab40dc1ab4e689921da54080b135e1d22b1c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 14 Mar 2017 21:45:23 +0100 Subject: Refactoring louloulibs and cmake Use OBJECT libraries Remove the louloulibs directory Write FOUND variables in the cache --- src/network/dns_handler.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/network/dns_handler.hpp (limited to 'src/network/dns_handler.hpp') diff --git a/src/network/dns_handler.hpp b/src/network/dns_handler.hpp new file mode 100644 index 0000000..c694452 --- /dev/null +++ b/src/network/dns_handler.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include +#ifdef UDNS_FOUND + +class Poller; + +#include + +#include +#include +#include + +class DNSHandler +{ +public: + explicit DNSHandler(std::shared_ptr& poller); + ~DNSHandler() = default; + + DNSHandler(const DNSHandler&) = delete; + DNSHandler(DNSHandler&&) = delete; + DNSHandler& operator=(const DNSHandler&) = delete; + DNSHandler& operator=(DNSHandler&&) = delete; + + void destroy(); + + static void watch(); + static void unwatch(); + +private: + /** + * Manager for the socket returned by udns, that we need to watch with the poller + */ + static std::unique_ptr socket_handler; +}; + +#endif /* UDNS_FOUND */ -- cgit v1.2.3