reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TurnAsyncTlsSocket.cxx
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
8#include "rutil/Lock.hxx"
9
10using namespace std;
11using namespace resip;
12
13#if defined(WIN32) && !defined(__GNUC__)
14#pragma warning( disable : 4355 )
15#endif
16
17namespace reTurn {
18
19TurnAsyncTlsSocket::TurnAsyncTlsSocket(asio::io_context& ioService,
20 asio::ssl::context& sslContext,
21 bool validateServerCertificateHostname,
22 TurnAsyncSocketHandler* turnAsyncSocketHandler,
23 const asio::ip::address& address,
24 unsigned short port) :
25 TurnAsyncSocket(ioService, *this, turnAsyncSocketHandler, address, port),
26 AsyncTlsSocketBase(ioService, sslContext, validateServerCertificateHostname)
27{
29
30 mBindError = bind(address, port);
31}
32
33void
34TurnAsyncTlsSocket::onConnectSuccess()
35{
36 {
39 }
41}
42
43void
44TurnAsyncTlsSocket::onConnectFailure(const asio::error_code& e)
45{
48}
49
50void
51TurnAsyncTlsSocket::onReceiveSuccess(const asio::ip::address& address, unsigned short port, const std::shared_ptr<DataBuffer>& data)
52{
53 handleReceivedData(address, port, data);
55}
56
57void
58TurnAsyncTlsSocket::onReceiveFailure(const asio::error_code& e)
59{
62}
63
64void
65TurnAsyncTlsSocket::onSendSuccess()
66{
69}
70
71void
72TurnAsyncTlsSocket::onSendFailure(const asio::error_code& e)
73{
76}
77
78} // namespace
79#endif
80
81/* ====================================================================
82
83 Copyright (c) 2008-2026, SIP Specturm, Inc. http://sipspectrum.com
84 Copyright (c) 2007-2008, Plantronics, Inc.
85 All rights reserved.
86
87 Redistribution and use in source and binary forms, with or without
88 modification, are permitted provided that the following conditions are
89 met:
90
91 1. Redistributions of source code must retain the above copyright
92 notice, this list of conditions and the following disclaimer.
93
94 2. Redistributions in binary form must reproduce the above copyright
95 notice, this list of conditions and the following disclaimer in the
96 documentation and/or other materials provided with the distribution.
97
98 3. Neither the name of Plantronics nor the names of its contributors
99 may be used to endorse or promote products derived from this
100 software without specific prior written permission.
101
102 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
103 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
104 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
105 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
106 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
107 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
108 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
109 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
110 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
111 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
112 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
113
114 ==================================================================== */
asio::ip::address mConnectedAddress
Connected Info and State.
asio::error_code bind(const asio::ip::address &address, unsigned short port) override
Note: The following API's are thread safe and queue the request to be handled by the ioService thread...
void setTransportType(TransportType transport)
Definition StunTuple.hxx:42
virtual void onReceiveFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onSendSuccess(unsigned int socketDesc)=0
virtual void onSendFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onConnectFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onConnectSuccess(unsigned int socketDesc, const asio::ip::address &address, unsigned short port)=0
resip::RecursiveMutex mHandlerMutex
void handleReceivedData(const asio::ip::address &address, unsigned short port, const std::shared_ptr< DataBuffer > &data)
TurnAsyncSocketHandler * mTurnAsyncSocketHandler
TurnAsyncTlsSocket(asio::io_context &ioService, asio::ssl::context &sslContext, bool validateServerCertificateHostname, TurnAsyncSocketHandler *turnAsyncSocketHandler, const asio::ip::address &address=UnspecifiedIpAddress, unsigned short port=0)
virtual unsigned int getSocketDescriptor()
dcm! – add UnusedChecking(_enum) below;
std::unique_lock< RecursiveMutex > RecursiveLock
Definition Lock.hxx:29