summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-03-28 13:40:14 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-03-28 13:40:43 (GMT)
commitb61486fefe602e0d18fa5279021006f87b965307 (patch)
tree437585cbef1179e1ec31f79789591d5610200c29 /Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
parentdae28dd45e43fc6e6ef2ec4c6c65d5d736ed86f8 (diff)
downloadswift-b61486fefe602e0d18fa5279021006f87b965307.zip
swift-b61486fefe602e0d18fa5279021006f87b965307.tar.bz2
Moved Swiften to a separate module.
Diffstat (limited to 'Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp')
m---------Swiften0
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp60
2 files changed, 0 insertions, 60 deletions
diff --git a/Swiften b/Swiften
new file mode 160000
+Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
deleted file mode 100644
index c4bfcb4..0000000
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h"
-
-#include <iostream>
-
-#include "Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h"
-#include "Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h"
-#include "Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h"
-#include "Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h"
-
-namespace Swift {
-
-AvahiQuerier::AvahiQuerier() : client(NULL), threadedPoll(NULL) {
-}
-
-AvahiQuerier::~AvahiQuerier() {
-}
-
-boost::shared_ptr<DNSSDBrowseQuery> AvahiQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new AvahiBrowseQuery(shared_from_this()));
-}
-
-boost::shared_ptr<DNSSDRegisterQuery> AvahiQuerier::createRegisterQuery(const String& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new AvahiRegisterQuery(name, port, info, shared_from_this()));
-}
-
-boost::shared_ptr<DNSSDResolveServiceQuery> AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new AvahiResolveServiceQuery(service, shared_from_this()));
-}
-
-boost::shared_ptr<DNSSDResolveHostnameQuery> AvahiQuerier::createResolveHostnameQuery(const String& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new AvahiResolveHostnameQuery(hostname, interfaceIndex, shared_from_this()));
-}
-
-void AvahiQuerier::start() {
- std::cout << "Starrting querier" << std::endl;
- assert(!threadedPoll);
- threadedPoll = avahi_threaded_poll_new();
- int error;
- assert(!client);
- client = avahi_client_new(
- avahi_threaded_poll_get(threadedPoll),
- static_cast<AvahiClientFlags>(0), NULL, this, &error); // TODO
- if (!client) {
- // TODO
- std::cerr << "Avahi Error: " << avahi_strerror(error) << std::endl;
- return;
- }
- std::cout << "Starrting event loop" << std::endl;
- avahi_threaded_poll_start(threadedPoll);
-}
-
-void AvahiQuerier::stop() {
- assert(threadedPoll);
- avahi_threaded_poll_stop(threadedPoll);
- assert(client);
- avahi_client_free(client);
- avahi_threaded_poll_free(threadedPoll);
-}
-
-}