diff options
Diffstat (limited to 'Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h')
-rw-r--r-- | Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h index de52321..16e9be6 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h @@ -11,7 +11,7 @@ #include "Swiften/Base/String.h" #include "Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h" #include "Swiften/LinkLocal/DNSSD/DNSSDResolveHostnameQuery.h" -#include "Swiften/EventLoop/MainEventLoop.h" +#include "Swiften/EventLoop/EventLoop.h" #include "Swiften/Network/HostAddress.h" #include <netinet/in.h> @@ -21,7 +21,7 @@ namespace Swift { class BonjourResolveHostnameQuery : public DNSSDResolveHostnameQuery, public BonjourQuery { public: - BonjourResolveHostnameQuery(const String& hostname, int interfaceIndex, boost::shared_ptr<BonjourQuerier> querier) : BonjourQuery(querier) { + BonjourResolveHostnameQuery(const String& hostname, int interfaceIndex, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) { DNSServiceErrorType result = DNSServiceGetAddrInfo( &sdRef, 0, interfaceIndex, kDNSServiceProtocol_IPv4, hostname.getUTF8Data(), @@ -37,7 +37,7 @@ namespace Swift { BonjourQuery::run(); } else { - MainEventLoop::postEvent(boost::bind(boost::ref(onHostnameResolved), boost::optional<HostAddress>()), shared_from_this()); + eventLoop->postEvent(boost::bind(boost::ref(onHostnameResolved), boost::optional<HostAddress>()), shared_from_this()); } } @@ -52,7 +52,7 @@ namespace Swift { void handleHostnameResolved(DNSServiceErrorType errorCode, const struct sockaddr *rawAddress) { if (errorCode) { - MainEventLoop::postEvent( + eventLoop->postEvent( boost::bind(boost::ref(onHostnameResolved), boost::optional<HostAddress>()), shared_from_this()); @@ -61,7 +61,7 @@ namespace Swift { assert(rawAddress->sa_family == AF_INET); const sockaddr_in* sa = reinterpret_cast<const sockaddr_in*>(rawAddress); uint32_t address = ntohl(sa->sin_addr.s_addr); - MainEventLoop::postEvent(boost::bind( + eventLoop->postEvent(boost::bind( boost::ref(onHostnameResolved), HostAddress(reinterpret_cast<unsigned char*>(&address), 4)), shared_from_this()); |