#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(); ~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; std::thread m_thread; }; #endif