blob: 9f7e4ad230273a4f36e973010d610e5a2486638a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <boost/bind.hpp>
#include <iostream>
#include "Swiften/LinkLocal/LinkLocalRoster.h"
namespace Swift {
LinkLocalRoster::LinkLocalRoster(boost::shared_ptr<DNSSDService> service) : dnsSDService(service) {
service->onServiceAdded.connect(boost::bind(&LinkLocalRoster::handleServiceAdded, this, _1));
service->onServiceRemoved.connect(boost::bind(&LinkLocalRoster::handleServiceRemoved, this, _1));
}
void LinkLocalRoster::handleServiceAdded(const DNSSDService::Service& service) {
std::cout << "Service added " << service.name << " " << service.type << " " << service.domain << std::endl;
}
void LinkLocalRoster::handleServiceRemoved(const DNSSDService::Service& service) {
std::cout << "Service removed " << service.name << " " << service.type << " " << service.domain << std::endl;
}
}
|