Kea  1.9.9-git
connection_pool.h
Go to the documentation of this file.
1 // Copyright (C) 2017-2021 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef HTTP_CONNECTION_POOL_H
8 #define HTTP_CONNECTION_POOL_H
9 
10 #include <http/connection.h>
11 
12 #include <list>
13 #include <mutex>
14 
15 namespace isc {
16 namespace http {
17 
31 public:
32 
39  void start(const HttpConnectionPtr& connection);
40 
50  void shutdown(const HttpConnectionPtr& connection);
51 
55  void stop(const HttpConnectionPtr& connection);
56 
58  void stopAll();
59 
60 protected:
61 
65  void stopAllInternal();
66 
68  std::list<HttpConnectionPtr> connections_;
69 
71  std::mutex mutex_;
72 };
73 
74 }
75 }
76 
77 #endif
78 
void start(const HttpConnectionPtr &connection)
Start new connection.
std::list< HttpConnectionPtr > connections_
Set of connections.
void stopAllInternal()
Stops all connections and removes them from the pool.
std::mutex mutex_
Mutex to protect the internal state.
void stop(const HttpConnectionPtr &connection)
Removes a connection from the pool and stops it.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void stopAll()
Stops all connections and removes them from the pool.
boost::shared_ptr< HttpConnection > HttpConnectionPtr
Pointer to the HttpConnection.
Definition: connection.h:38
void shutdown(const HttpConnectionPtr &connection)
Removes a connection from the pool and shutdown it.
Pool of active HTTP connections.