reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
UdpRelayServer.hxx
Go to the documentation of this file.
1
#ifndef UDP_RELAY_SERVER_HXX
2
#define UDP_RELAY_SERVER_HXX
3
4
#include <asio.hpp>
5
#ifdef USE_SSL
6
#include <asio/ssl.hpp>
7
#endif
8
#include <string>
9
#include "
RequestHandler.hxx
"
10
#include "
AsyncUdpSocketBase.hxx
"
11
12
namespace
reTurn
{
13
14
class
StunTuple;
15
16
class
UdpRelayServer
17
:
public
AsyncUdpSocketBase
18
{
19
public
:
21
explicit
UdpRelayServer
(asio::io_context&
ioService
,
TurnAllocation
&
turnAllocation
);
22
UdpRelayServer
(
const
UdpRelayServer
&) =
delete
;
23
UdpRelayServer
(
UdpRelayServer
&&) =
delete
;
24
~UdpRelayServer
();
25
26
UdpRelayServer
&
operator=
(
const
UdpRelayServer
&) =
delete
;
27
UdpRelayServer
&
operator=
(
UdpRelayServer
&&) =
delete
;
28
30
bool
startReceiving
();
31
33
void
stop
();
34
35
private
:
37
virtual
void
onReceiveSuccess(
const
asio::ip::address& address,
unsigned
short
port,
const
std::shared_ptr<DataBuffer>& data);
38
virtual
void
onReceiveFailure(
const
asio::error_code&
e
);
39
41
virtual
void
onSendSuccess();
42
virtual
void
onSendFailure(
const
asio::error_code&
e
);
43
44
TurnAllocation
& mTurnAllocation;
45
bool
mStopping;
46
bool
mBindSuccess;
47
asio::error_code mLastSendErrorCode;
// Use to ensure we only log at Warning level once for a particular send error
48
};
49
50
typedef
std::shared_ptr<UdpRelayServer>
UdpRelayServerPtr
;
51
52
}
53
54
#endif
55
56
57
/* ====================================================================
58
59
Copyright (c) 2007-2008, Plantronics, Inc.
60
All rights reserved.
61
62
Redistribution and use in source and binary forms, with or without
63
modification, are permitted provided that the following conditions are
64
met:
65
66
1. Redistributions of source code must retain the above copyright
67
notice, this list of conditions and the following disclaimer.
68
69
2. Redistributions in binary form must reproduce the above copyright
70
notice, this list of conditions and the following disclaimer in the
71
documentation and/or other materials provided with the distribution.
72
73
3. Neither the name of Plantronics nor the names of its contributors
74
may be used to endorse or promote products derived from this
75
software without specific prior written permission.
76
77
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
78
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
79
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
80
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
81
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
82
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
83
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
84
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
85
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
87
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
89
==================================================================== */
AsyncUdpSocketBase.hxx
RequestHandler.hxx
reTurn::AsyncUdpSocketBase
Definition
AsyncUdpSocketBase.hxx:14
reTurn::TurnAllocation
Definition
TurnAllocation.hxx:29
reTurn::UdpRelayServer
Definition
UdpRelayServer.hxx:18
reTurn::UdpRelayServer::operator=
UdpRelayServer & operator=(const UdpRelayServer &)=delete
reTurn::UdpRelayServer::startReceiving
bool startReceiving()
Starts processing.
Definition
UdpRelayServer.cxx:40
reTurn::UdpRelayServer::~UdpRelayServer
~UdpRelayServer()
Definition
UdpRelayServer.cxx:34
reTurn::UdpRelayServer::UdpRelayServer
UdpRelayServer(UdpRelayServer &&)=delete
reTurn::UdpRelayServer::operator=
UdpRelayServer & operator=(UdpRelayServer &&)=delete
reTurn::UdpRelayServer::UdpRelayServer
UdpRelayServer(const UdpRelayServer &)=delete
reTurn::UdpRelayServer::stop
void stop()
Causes this object to destroy itself safely (ie. waiting for asynchronous callbacks to finish)
Definition
UdpRelayServer.cxx:56
reTurn
Definition
AsyncSocketBase.cxx:16
reTurn::UdpRelayServerPtr
std::shared_ptr< UdpRelayServer > UdpRelayServerPtr
Definition
UdpRelayServer.hxx:50
list
void list()
Definition
userAdmin.cxx:66
reTurn
UdpRelayServer.hxx
Generated by
1.9.8