LibreOffice Module sd (master) 1
ZeroconfService.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9#ifndef ZEROCONF_SERVICE
10#define ZEROCONF_SERVICE
11
12#include <string>
13#include <utility>
14
18#define PORT_DISCOVERY 1598
19#define BUFFER_SIZE 200
20
21#define kREG_TYPE "_impressremote._tcp"
22
23struct sockaddr_in;
24
25typedef unsigned int uint;
26
27namespace sd{
28
30 {
31 protected:
32 std::string name;
34
35 public:
36 explicit ZeroconfService(std::string aname, uint aport)
37 :name(std::move(aname)), port(aport){}
38 virtual ~ZeroconfService(){}
39
40 const std::string& getName() const {return name;}
41 void setName(const char * n) {name = n;}
42
43 // Clean up the service when closing
44 virtual void clear() = 0;
45 // Bonjour for OSX, Avahi for Linux
46 virtual void setup() = 0;
47 };
48
49}
50#endif
unsigned int uint
const std::string & getName() const
ZeroconfService(std::string aname, uint aport)
virtual void setup()=0
void setName(const char *n)
virtual void clear()=0
unsigned int uint
sal_Int64 n