summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h8
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
index 4b8987f..44a82ee 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
@@ -21,21 +21,19 @@ namespace Swift {
}
void startBrowsing() {
- assert(!browser);
std::cout << "Start browsing" << std::endl;
+ assert(!browser);
avahi_threaded_poll_lock(querier->getThreadedPoll());
- std::cout << "Creating browser" << std::endl;
browser = avahi_service_browser_new(querier->getClient(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_presence._tcp", NULL, (AvahiLookupFlags) 0, &handleServiceDiscoveredStatic, this);
if (!browser) {
std::cout << "Error" << std::endl;
MainEventLoop::postEvent(boost::bind(boost::ref(onError)), shared_from_this());
}
- std::cout << "Unlocking" << std::endl;
avahi_threaded_poll_unlock(querier->getThreadedPoll());
- std::cout << "Browse started" << std::endl;
}
void stopBrowsing() {
+ std::cout << "Stop browsing" << std::endl;
avahi_threaded_poll_lock(querier->getThreadedPoll());
avahi_service_browser_free(browser);
browser = NULL;
@@ -55,7 +53,7 @@ namespace Swift {
break;
case AVAHI_BROWSER_NEW: {
DNSSDServiceID service(name, domain, type, interfaceIndex);
- std::cout << "Service discovered " << name << " " << type << " " << domain << std::endl;
+ std::cout << "Service discovered " << name << " " << type << " " << domain << " " << interfaceIndex << std::endl;
MainEventLoop::postEvent(boost::bind(boost::ref(onServiceAdded), service), shared_from_this());
break;
}
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
index 4b0a490..b173b9a 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
@@ -21,7 +21,7 @@ namespace Swift {
}
void start() {
- std::cout << "Resolving " << service.getName() << std::endl;
+ std::cout << "Start resolving " << service.getName() << std::endl;
avahi_threaded_poll_lock(querier->getThreadedPoll());
assert(!resolver);
resolver = avahi_service_resolver_new(querier->getClient(), service.getNetworkInterfaceID(), AVAHI_PROTO_UNSPEC, service.getName().getUTF8Data(), service.getType().getUTF8Data(), service.getDomain().getUTF8Data(), AVAHI_PROTO_UNSPEC, (AvahiLookupFlags) 0, handleServiceResolvedStatic, this);
@@ -33,6 +33,7 @@ namespace Swift {
}
void stop() {
+ std::cout << "Stop resolving" << std::endl;
avahi_threaded_poll_lock(querier->getThreadedPoll());
avahi_service_resolver_free(resolver);
resolver = NULL;
@@ -52,6 +53,7 @@ namespace Swift {
MainEventLoop::postEvent(boost::bind(boost::ref(onServiceResolved), boost::optional<Result>()), shared_from_this());
break;
case AVAHI_RESOLVER_FOUND: {
+ std::cout << "Success" << std::endl;
char a[AVAHI_ADDRESS_STR_MAX];
avahi_address_snprint(a, sizeof(a), address);