Kea 2.7.5
connection_pool.h
Go to the documentation of this file.
1// Copyright (C) 2017-2024 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
15namespace isc {
16namespace http {
17
31public:
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
60protected:
61
65 void stopAllInternal();
66
68 std::list<HttpConnectionPtr> connections_;
69
71 std::mutex mutex_;
72};
73
75typedef std::shared_ptr<HttpConnectionPool> HttpConnectionPoolPtr;
76
77}
78}
79
80#endif
Pool of active HTTP connections.
void stopAll()
Stops all connections and removes them from the pool.
void stop(const HttpConnectionPtr &connection)
Removes a connection from the pool and stops it.
void start(const HttpConnectionPtr &connection)
Start new connection.
std::list< HttpConnectionPtr > connections_
Set of connections.
std::mutex mutex_
Mutex to protect the internal state.
void stopAllInternal()
Stops all connections and removes them from the pool.
void shutdown(const HttpConnectionPtr &connection)
Removes a connection from the pool and shutdown it.
std::shared_ptr< HttpConnectionPool > HttpConnectionPoolPtr
Pointer to the HttpConnectionPool.
boost::shared_ptr< HttpConnection > HttpConnectionPtr
Pointer to the HttpConnection.
Definition connection.h:41
Defines the logger used by the top-level component of kea-lfc.