![]() |
Kea
1.5.0
|
Pool of active HTTP connections. More...
#include <connection_pool.h>
Public Member Functions | |
| void | start (const HttpConnectionPtr &connection) |
| Start new connection. More... | |
| void | stop (const HttpConnectionPtr &connection) |
| Stops a connection and removes it from the pool. More... | |
| void | stopAll () |
| Stops all connections and removes them from the pool. More... | |
Protected Attributes | |
| std::list< HttpConnectionPtr > | connections_ |
| Set of connections. More... | |
Pool of active HTTP connections.
The HTTP server is designed to handle many connections simultaneously. The communication between the client and the server may take long time and the server must be able to react on other events while the communication with the clients is in progress. Thus, the server must track active connections and gracefully close them when needed. An obvious case when the connections must be terminated by the server is when the shutdown signal is received.
This object is a simple container for the server connections which provides means to terminate them on request.
Definition at line 28 of file connection_pool.h.
| void isc::http::HttpConnectionPool::start | ( | const HttpConnectionPtr & | connection | ) |
Start new connection.
The connection is inserted to the pool and the HttpConnection::asyncAccept is invoked.
| connection | Pointer to the new connection. |
Definition at line 16 of file connection_pool.cc.
References connections_.
| void isc::http::HttpConnectionPool::stop | ( | const HttpConnectionPtr & | connection | ) |
Stops a connection and removes it from the pool.
If the connection is not found in the pool, this method is no-op.
| connection | Pointer to the connection. |
Definition at line 22 of file connection_pool.cc.
References connections_.
| void isc::http::HttpConnectionPool::stopAll | ( | ) |
Stops all connections and removes them from the pool.
Definition at line 28 of file connection_pool.cc.
References connections_.
Referenced by isc::http::HttpListenerImpl::stop().
|
protected |
Set of connections.
Definition at line 52 of file connection_pool.h.