|
Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
|
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. | |
Manages active HTTP connections.
| 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.
| proactor | The proactor for I/O. |
| router | The router. |
| thread_pool | The thread pool. |
| timer_manager | The timer manager. |
| max_body_size | The maximum body size allowed. |
| tls_context | The TLS context (optional). |
| void server::ConnectionManager::add_connection | ( | network::Socket | socket, |
| const std::string & | client_ip | ||
| ) |
Adds a new connection to the manager.
| socket | The connection socket. |
| client_ip | The client's IP address. |
| size_t server::ConnectionManager::get_connection_count | ( | ) | const |
Gets the current number of active connections.
| void server::ConnectionManager::remove_connection | ( | int | fd | ) |
Removes a connection by file descriptor.
| fd | The file descriptor. |