Kea  1.5.0
isc::http::HttpConnectionPool Class Reference

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< HttpConnectionPtrconnections_
 Set of connections. More...
 

Detailed Description

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.

Member Function Documentation

◆ start()

void isc::http::HttpConnectionPool::start ( const HttpConnectionPtr connection)

Start new connection.

The connection is inserted to the pool and the HttpConnection::asyncAccept is invoked.

Parameters
connectionPointer to the new connection.

Definition at line 16 of file connection_pool.cc.

References connections_.

◆ stop()

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.

Parameters
connectionPointer to the connection.

Definition at line 22 of file connection_pool.cc.

References connections_.

◆ stopAll()

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().

Member Data Documentation

◆ connections_

std::list<HttpConnectionPtr> isc::http::HttpConnectionPool::connections_
protected

Set of connections.

Definition at line 52 of file connection_pool.h.

Referenced by start(), stop(), and stopAll().


The documentation for this class was generated from the following files: