blob: 6773d51bbb2c2dd6d60d9818f3a91e135fb71188 (
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::DiscoveredService& service) {
std::cout << "Service added " << service.name << " " << service.type << " " << service.domain << std::endl;
}
void LinkLocalRoster::handleServiceRemoved(const DNSSDService::DiscoveredService& service) {
std::cout << "Service removed " << service.name << " " << service.type << " " << service.domain << std::endl;
}
}
|