summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-16 20:06:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-16 20:06:28 (GMT)
commit2c954f7e9464b8fdd970eed829e2ba632e8979d8 (patch)
tree2e15a454cb395e77bd4af858311fdc046d0cc2bd /Swiften/LinkLocal/AppleDNSSDService.h
parenta5afa80ca54da1b72078b3e508de1d80cceb0c90 (diff)
downloadswift-2c954f7e9464b8fdd970eed829e2ba632e8979d8.zip
swift-2c954f7e9464b8fdd970eed829e2ba632e8979d8.tar.bz2
Implemented AppleDNSSDService registration & browsing.
Diffstat (limited to 'Swiften/LinkLocal/AppleDNSSDService.h')
-rw-r--r--Swiften/LinkLocal/AppleDNSSDService.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Swiften/LinkLocal/AppleDNSSDService.h b/Swiften/LinkLocal/AppleDNSSDService.h
index e6bedf7..3607ce0 100644
--- a/Swiften/LinkLocal/AppleDNSSDService.h
+++ b/Swiften/LinkLocal/AppleDNSSDService.h
@@ -2,6 +2,8 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <dns_sd.h>
#include "Swiften/LinkLocal/DNSSDService.h"
#include "Swiften/EventLoop/EventOwner.h"
@@ -12,15 +14,27 @@ namespace Swift {
AppleDNSSDService();
~AppleDNSSDService();
- virtual void publishService(const std::map<String,String> properties);
+ virtual void registerService(const String& name, int port, const std::map<String,String>& properties);
+ virtual void unregisterService();
virtual void start();
virtual void stop();
private:
void doStart();
+ void interruptSelect();
+
+ static void handleServiceDiscoveredGlobal(DNSServiceRef, DNSServiceFlags, uint32_t, DNSServiceErrorType, const char *, const char *, const char *, void*);
+ void handleServiceDiscovered(DNSServiceRef, DNSServiceFlags, uint32_t, DNSServiceErrorType, const char *, const char *, const char *);
+ static void handleServiceRegisteredGlobal(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType, const char *, const char *, const char *, void *);
+ void handleServiceRegistered(DNSServiceRef, DNSServiceFlags, DNSServiceErrorType, const char *, const char *, const char *);
private:
boost::thread* thread;
bool stopRequested;
+ int interruptSelectReadSocket;
+ int interruptSelectWriteSocket;
+ boost::mutex sdRefsMutex;
+ DNSServiceRef browseSDRef;
+ DNSServiceRef registerSDRef;
};
}