diff options
Diffstat (limited to 'Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h')
-rw-r--r-- | Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h index 4da9bfd..5570559 100644 --- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h +++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h @@ -14,44 +14,44 @@ #include <Swiften/LinkLocal/DNSSD/DNSSDRegisterQuery.h> namespace Swift { - class AvahiQuerier; + class AvahiQuerier; - class AvahiRegisterQuery : public DNSSDRegisterQuery, public AvahiQuery { - public: - AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) { - } + class AvahiRegisterQuery : public DNSSDRegisterQuery, public AvahiQuery { + public: + AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) { + } - void registerService(); - void unregisterService(); - void updateServiceInfo(const ByteArray& txtRecord); + void registerService(); + void unregisterService(); + void updateServiceInfo(const ByteArray& txtRecord); - private: - void doRegisterService(); + private: + void doRegisterService(); - static void handleEntryGroupChange(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { - static_cast<AvahiRegisterQuery*>(userdata)->handleEntryGroupChange(g, state); - } + static void handleEntryGroupChange(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { + static_cast<AvahiRegisterQuery*>(userdata)->handleEntryGroupChange(g, state); + } - void handleEntryGroupChange(AvahiEntryGroup* g, AvahiEntryGroupState state); + void handleEntryGroupChange(AvahiEntryGroup* g, AvahiEntryGroupState state); /* - static void handleServiceRegisteredStatic(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context) { - static_cast<AvahiRegisterQuery*>(context)->handleServiceRegistered(errorCode, name, regtype, domain); - } - - void handleServiceRegistered(DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain) { - if (errorCode != kDNSServiceErr_NoError) { - eventLoop->postEvent(boost::bind(boost::ref(onRegisterFinished), boost::optional<DNSSDServiceID>()), shared_from_this()); - } - else { - } - } - */ - - private: - std::string name; - int port; - ByteArray txtRecord; - AvahiEntryGroup* group; - }; + static void handleServiceRegisteredStatic(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context) { + static_cast<AvahiRegisterQuery*>(context)->handleServiceRegistered(errorCode, name, regtype, domain); + } + + void handleServiceRegistered(DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain) { + if (errorCode != kDNSServiceErr_NoError) { + eventLoop->postEvent(boost::bind(boost::ref(onRegisterFinished), boost::optional<DNSSDServiceID>()), shared_from_this()); + } + else { + } + } + */ + + private: + std::string name; + int port; + ByteArray txtRecord; + AvahiEntryGroup* group; + }; } |