reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TurnAsyncTlsSocket.hxx
Go to the documentation of this file.
1
2#if defined(HAVE_CONFIG_H)
3 #include "config.h"
4#endif
5
6#ifdef USE_SSL
7#ifndef TURNASYNCTLSSOCKET_HXX
8#define TURNASYNCTLSSOCKET_HXX
9
10#include <asio.hpp>
11#include <asio/ssl.hpp>
12
15
16namespace reTurn {
17
19{
20public:
21 explicit TurnAsyncTlsSocket(asio::io_context& ioService,
22 asio::ssl::context& sslContext,
25 const asio::ip::address& address = UnspecifiedIpAddress,
26 unsigned short port = 0);
27
28 virtual unsigned int getSocketDescriptor() { return (unsigned int)mSocket.lowest_layer().native_handle(); }
29
30protected:
31
32private:
33 // AsyncTcpSocketBase callbacks
34 virtual void onConnectSuccess();
35 virtual void onConnectFailure(const asio::error_code& e);
36 virtual void onReceiveSuccess(const asio::ip::address& address, unsigned short port, const std::shared_ptr<DataBuffer>& data);
37 virtual void onReceiveFailure(const asio::error_code& e);
38 virtual void onSendSuccess();
39 virtual void onSendFailure(const asio::error_code& e);
40};
41
42}
43
44#endif
45#endif
46
47/* ====================================================================
48
49 Copyright (c) 2007-2008, Plantronics, Inc.
50 Copyright (c) 2008-2018, SIP Spectrum, Inc.
51 All rights reserved.
52
53 Redistribution and use in source and binary forms, with or without
54 modification, are permitted provided that the following conditions are
55 met:
56
57 1. Redistributions of source code must retain the above copyright
58 notice, this list of conditions and the following disclaimer.
59
60 2. Redistributions in binary form must reproduce the above copyright
61 notice, this list of conditions and the following disclaimer in the
62 documentation and/or other materials provided with the distribution.
63
64 3. Neither the name of Plantronics nor the names of its contributors
65 may be used to endorse or promote products derived from this
66 software without specific prior written permission.
67
68 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
69 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
70 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
71 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
72 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
73 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
74 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
75 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
76 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
77 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
78 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
79
80 ==================================================================== */
asio::ssl::stream< asio::ip::tcp::socket > mSocket
static asio::ip::address UnspecifiedIpAddress
virtual unsigned int getSocketDescriptor()
void list()
Definition userAdmin.cxx:66