/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include #include #include #include #include "Swiften/Network/DomainNameResolver.h" namespace Swift { class CAresQuery; class CAresDomainNameResolver : public DomainNameResolver { public: CAresDomainNameResolver(); ~CAresDomainNameResolver(); virtual boost::shared_ptr createServiceQuery(const String& name); virtual boost::shared_ptr createAddressQuery(const String& name); private: friend class CAresQuery; void run(); void addToQueue(boost::shared_ptr); private: bool stopRequested; ares_channel channel; boost::thread* thread; boost::mutex pendingQueriesMutex; std::list< boost::shared_ptr > pendingQueries; }; }