blob: 65af3bc89bb4f20e559ff12f3a13a0ea0b7fb317 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include <string>
#include <boost/bind.hpp>
#include "Swiften/Base/Platform.h"
#if defined(SWIFTEN_PLATFORM_MACOSX) || defined(SWIFTEN_PLATFORM_WINDOWS)
#include "Swiften/LinkLocal/AppleDNSSDService.h"
#else
#include "Swiften/LinkLocal/AvahiDNSSDService.h"
#endif
#include "Slimber/Server.h"
#include "Slimber/FileVCardCollection.h"
#include "Swiften/LinkLocal/LinkLocalRoster.h"
#include "Swiften/LinkLocal/BonjourQuerier.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
#include "Swiften/Application/Platform/PlatformApplication.h"
using namespace Swift;
int main() {
SimpleEventLoop eventLoop;
boost::shared_ptr<BonjourQuerier> querier(new BonjourQuerier());
querier->start();
boost::shared_ptr<DNSSDBrowseQuery> query = querier->createBrowseQuery();
query->startBrowsing();
boost::shared_ptr<DNSSDPublishQuery> query2 = querier->createPublishQuery("remko", 1234, LinkLocalServiceInfo());
query2->publish();
/*
boost::shared_ptr<DNSSDService> dnsSDService;
#if defined(SWIFTEN_PLATFORM_MACOSX) || defined(SWIFTEN_PLATFORM_WINDOWS)
dnsSDService = boost::shared_ptr<AppleDNSSDService>(
new AppleDNSSDService());
#else
dnsSDService = boost::shared_ptr<AvahiDNSSDService>(
new AvahiDNSSDService());
#endif
boost::shared_ptr<LinkLocalRoster> linkLocalRoster = boost::shared_ptr<LinkLocalRoster>(new LinkLocalRoster(dnsSDService));
FileVCardCollection vCardCollection(PlatformApplication("Slimber").getSettingsDir());
Server server(5222, 5562, linkLocalRoster, dnsSDService, &vCardCollection);
*/
eventLoop.run();
return 0;
}
|