#ifndef __RESOLVSERVICE_HPP__ #define __RESOLVSERVICE_HPP__ #include #include #include #include #include #include #include #include class ResolvService { struct QueueItem { uint32_t ip; std::function callback; }; public: ResolvService( uint16_t port ); ~ResolvService(); void Query( uint32_t ip, const std::function& callback ); private: void Worker(); std::atomic m_exit; std::mutex m_lock; std::condition_variable m_cv; std::vector m_queue; uint16_t m_port; std::thread m_thread; }; #endif