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