summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-26 08:21:20 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-26 14:52:17 (GMT)
commit26d623d3cfd8937fb52acf76ef33d230f5010538 (patch)
treeade8246f719fa4dee9de1daaa2ba3f7b6c324e53 /Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
parent2833b8f09c9aef09004662a2a89eefbaee1e4247 (diff)
downloadswift-26d623d3cfd8937fb52acf76ef33d230f5010538.zip
swift-26d623d3cfd8937fb52acf76ef33d230f5010538.tar.bz2
Implement fake DNSSD querier.
Diffstat (limited to 'Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h')
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
index 62d8606..8e3181e 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
@@ -14,14 +14,17 @@ namespace Swift {
&sdRef, 0, 0, "_presence._tcp", 0,
&BonjourBrowseQuery::handleServiceDiscoveredStatic, this);
if (result != kDNSServiceErr_NoError) {
- std::cout << "Error" << std::endl;
- // TODO
+ sdRef = NULL;
}
}
void startBrowsing() {
- assert(sdRef);
- run();
+ if (!sdRef) {
+ MainEventLoop::postEvent(boost::bind(boost::ref(onError)), shared_from_this());
+ }
+ else {
+ run();
+ }
}
void stopBrowsing() {
@@ -35,7 +38,7 @@ namespace Swift {
void handleServiceDiscovered(DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *name, const char *type, const char *domain) {
if (errorCode != kDNSServiceErr_NoError) {
- return;
+ MainEventLoop::postEvent(boost::bind(boost::ref(onError)), shared_from_this());
}
else {
DNSSDServiceID service(name, type, domain, interfaceIndex);