LibreOffice Module io (master) 1
acceptor.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <osl/pipe.hxx>
23#include <osl/socket.hxx>
24#include <mutex>
25
26#include <com/sun/star/uno/Reference.hxx>
27
28namespace com::sun::star::connection { class XConnection; }
29
30namespace io_acceptor {
31
33 {
34 public:
35 PipeAcceptor( OUString sPipeName, OUString sConnectionDescription );
36
37 void init();
38 css::uno::Reference < css::connection::XConnection > accept( );
39
40 void stopAccepting();
41
42 private:
43 std::mutex m_mutex;
44 ::osl::Pipe m_pipe;
45 OUString m_sPipeName;
48 };
49
51 {
52 public:
53 SocketAcceptor( OUString sSocketName ,
54 sal_uInt16 nPort,
55 bool bTcpNoDelay,
56 OUString sConnectionDescription );
57
58 void init();
59 css::uno::Reference < css::connection::XConnection > accept();
60
61 void stopAccepting();
62
63 private:
64 ::osl::SocketAddr m_addr;
65 ::osl::AcceptorSocket m_socket;
66 OUString m_sSocketName;
68 sal_uInt16 m_nPort;
71 };
72
73}
74
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::connection::XConnection > accept()
Definition: acc_pipe.cxx:143
PipeAcceptor(OUString sPipeName, OUString sConnectionDescription)
Definition: acc_pipe.cxx:125
OUString m_sConnectionDescription
Definition: acceptor.hxx:46
SocketAcceptor(OUString sSocketName, sal_uInt16 nPort, bool bTcpNoDelay, OUString sConnectionDescription)
Definition: acc_socket.cxx:268
::osl::AcceptorSocket m_socket
Definition: acceptor.hxx:65
css::uno::Reference< css::connection::XConnection > accept()
Definition: acc_socket.cxx:311
::osl::SocketAddr m_addr
Definition: acceptor.hxx:64