reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TlsServer.hxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#ifndef TLS_SERVER_HXX
6#define TLS_SERVER_HXX
7
8#ifdef USE_SSL
9
10#include <asio.hpp>
11#include <asio/ssl.hpp>
12#include <string>
13#include "TlsConnection.hxx"
14#include "ConnectionManager.hxx"
15#include "RequestHandler.hxx"
16
17namespace reTurn {
18
20{
21public:
22 // noncopyable
23 TlsServer(const TlsServer&) = delete;
24 TlsServer& operator=(const TlsServer&) = delete;
25
27 explicit TlsServer(asio::io_context& ioService, RequestHandler& requestHandler, const asio::ip::address& address, unsigned short port);
28
29 void start();
30
31private:
33 void handleAccept(const asio::error_code& e);
34
36 std::string getPassword() const;
37
39 asio::io_context& mIOService;
40
42 asio::ip::tcp::acceptor mAcceptor;
43
45 asio::ssl::context mContext;
46
48 ConnectionManager mConnectionManager;
49
51 ConnectionPtr mNewConnection;
52
54 RequestHandler& mRequestHandler;
55};
56
57}
58
59#endif
60#endif
61
62/* ====================================================================
63
64 Copyright (c) 2007-2008, Plantronics, Inc.
65 All rights reserved.
66
67 Redistribution and use in source and binary forms, with or without
68 modification, are permitted provided that the following conditions are
69 met:
70
71 1. Redistributions of source code must retain the above copyright
72 notice, this list of conditions and the following disclaimer.
73
74 2. Redistributions in binary form must reproduce the above copyright
75 notice, this list of conditions and the following disclaimer in the
76 documentation and/or other materials provided with the distribution.
77
78 3. Neither the name of Plantronics nor the names of its contributors
79 may be used to endorse or promote products derived from this
80 software without specific prior written permission.
81
82 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
83 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
84 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
85 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
86 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
87 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
88 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
89 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
90 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
91 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
92 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
93
94 ==================================================================== */
Manages open connections so that they may be cleanly stopped when the server needs to shut down,...
The common handler for all incoming requests.
TlsServer & operator=(const TlsServer &)=delete
TlsServer(const TlsServer &)=delete
std::shared_ptr< AsyncSocketBase > ConnectionPtr
void list()
Definition userAdmin.cxx:66