2012-08-02 11:28:38 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
#ifndef _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
|
|
|
|
#define _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-05-10 17:42:35 +02:00
|
|
|
#ifndef _WIN32
|
2012-08-02 11:28:38 +02:00
|
|
|
#include <unistd.h>
|
2013-05-10 17:42:35 +02:00
|
|
|
#endif
|
2012-08-02 11:28:38 +02:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <osl/socket.hxx>
|
|
|
|
#include <rtl/ref.hxx>
|
2012-11-23 17:59:41 +01:00
|
|
|
#include <osl/thread.hxx>
|
2012-08-02 11:28:38 +02:00
|
|
|
|
2013-07-25 12:03:31 +02:00
|
|
|
#ifdef MACOSX
|
|
|
|
#include <osl/conditn.hxx> // Include this early to avoid error as check() gets defined by some SDK header to empty
|
|
|
|
#include <premac.h>
|
|
|
|
#import <CoreFoundation/CoreFoundation.h>
|
|
|
|
#include <postmac.h>
|
|
|
|
#import "OSXNetworkService.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2012-08-02 11:28:38 +02:00
|
|
|
/**
|
|
|
|
* The port for use for the main communication between LibO and remote control app.
|
|
|
|
*/
|
|
|
|
#define PORT_DISCOVERY 1598
|
2012-08-06 16:14:01 +02:00
|
|
|
#define BUFFER_SIZE 200
|
2012-08-02 11:28:38 +02:00
|
|
|
|
|
|
|
#define CHARSET RTL_TEXTENCODING_UTF8
|
|
|
|
|
2012-08-02 16:40:31 +02:00
|
|
|
struct sockaddr_in;
|
|
|
|
|
2012-08-02 11:28:38 +02:00
|
|
|
namespace sd
|
|
|
|
{
|
|
|
|
|
2012-08-02 16:40:31 +02:00
|
|
|
|
|
|
|
|
2012-11-23 17:59:41 +01:00
|
|
|
class DiscoveryService : public osl::Thread
|
2012-08-02 11:28:38 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void setup();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DiscoveryService();
|
|
|
|
~DiscoveryService();
|
2012-08-02 12:27:19 +02:00
|
|
|
|
2012-08-02 11:28:38 +02:00
|
|
|
static DiscoveryService *spService;
|
2012-11-23 17:59:41 +01:00
|
|
|
virtual void SAL_CALL run();
|
2012-08-02 11:28:38 +02:00
|
|
|
|
2013-07-21 14:09:10 +02:00
|
|
|
// osl::DatagramSocket mSocket;
|
2013-07-25 12:03:31 +02:00
|
|
|
#ifdef MACOSX
|
|
|
|
OSXNetworkService * osxservice;
|
|
|
|
#endif
|
2013-07-21 14:09:10 +02:00
|
|
|
int mSocket;
|
2012-08-02 11:28:38 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
|
2012-11-23 17:59:41 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|