Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
server::ConnectionManager Class Reference

Manages active HTTP connections. More...

#include <ConnectionManager.hpp>

Public Member Functions

 ConnectionManager (network::Proactor &proactor, const routing::Router &router, concurrency::ThreadPool &thread_pool, TimerManager &timer_manager, size_t max_body_size, network::TlsContext *tls_context=nullptr)
 Constructs a ConnectionManager.
 
void add_connection (network::Socket socket, const std::string &client_ip)
 Adds a new connection to the manager.
 
void remove_connection (int fd)
 Removes a connection by file descriptor.
 
size_t get_connection_count () const
 Gets the current number of active connections.
 

Detailed Description

Manages active HTTP connections.

Constructor & Destructor Documentation

◆ ConnectionManager()

server::ConnectionManager::ConnectionManager ( network::Proactor proactor,
const routing::Router router,
concurrency::ThreadPool thread_pool,
TimerManager timer_manager,
size_t  max_body_size,
network::TlsContext tls_context = nullptr 
)

Constructs a ConnectionManager.

Parameters
proactorThe proactor for I/O.
routerThe router.
thread_poolThe thread pool.
timer_managerThe timer manager.
max_body_sizeThe maximum body size allowed.
tls_contextThe TLS context (optional).

Member Function Documentation

◆ add_connection()

void server::ConnectionManager::add_connection ( network::Socket  socket,
const std::string &  client_ip 
)

Adds a new connection to the manager.

Parameters
socketThe connection socket.
client_ipThe client's IP address.

◆ get_connection_count()

size_t server::ConnectionManager::get_connection_count ( ) const

Gets the current number of active connections.

Returns
The number of connections.

◆ remove_connection()

void server::ConnectionManager::remove_connection ( int  fd)

Removes a connection by file descriptor.

Parameters
fdThe file descriptor.

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