reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ConnectionManager.hxx
Go to the documentation of this file.
1#ifndef CONNECTION_MANAGER_HXX
2#define CONNECTION_MANAGER_HXX
3
4#include <map>
5#include "AsyncSocketBase.hxx"
6
7namespace reTurn {
8
9class TurnManager;
10
15{
16public:
17 // noncopyable
21
24 void start(ConnectionPtr c, const asio::ip::address& remoteAddress);
25
27 void stop(ConnectionPtr c);
28
30 void stopAll();
31
32private:
33 TurnManager& mTurnManager;
34
36 std::map<ConnectionPtr, asio::ip::address> mConnections;
37};
38
39}
40
41#endif
42
43
44/* ====================================================================
45
46 Copyright (c) 2008-2026 SIP Spectrum, Inc. https://www.sipspectrum.com
47 Copyright (c) 2007-2008, Plantronics, Inc.
48 All rights reserved.
49
50 Redistribution and use in source and binary forms, with or without
51 modification, are permitted provided that the following conditions are
52 met:
53
54 1. Redistributions of source code must retain the above copyright
55 notice, this list of conditions and the following disclaimer.
56
57 2. Redistributions in binary form must reproduce the above copyright
58 notice, this list of conditions and the following disclaimer in the
59 documentation and/or other materials provided with the distribution.
60
61 3. Neither the name of Plantronics nor the names of its contributors
62 may be used to endorse or promote products derived from this
63 software without specific prior written permission.
64
65 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
67 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
68 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
69 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
70 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
71 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
72 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
73 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
75 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76
77 ==================================================================== */
Manages open connections so that they may be cleanly stopped when the server needs to shut down,...
void stop(ConnectionPtr c)
Stop the specified connection.
ConnectionManager & operator=(const ConnectionManager &)=delete
ConnectionManager(TurnManager &turnManager)
ConnectionManager(const ConnectionManager &)=delete
void stopAll()
Stop all connections.
void start(ConnectionPtr c, const asio::ip::address &remoteAddress)
Add the specified connection, from remoteAddress, to the manager and start it - or,...
std::shared_ptr< AsyncSocketBase > ConnectionPtr
void list()
Definition userAdmin.cxx:66