Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
orbit::network::ConnectionPool Class Reference

#include <ConnectionPool.hpp>

Public Member Functions

std::pair< int, void * > acquire (const std::string &host, int port)
 
void release (const std::string &host, int port, int fd, void *ssl=nullptr)
 
void cleanup_stale_connections ()
 
 ~ConnectionPool ()
 

Static Public Member Functions

static ConnectionPool & get_instance ()
 

Private Member Functions

 ConnectionPool ()=default
 

Private Attributes

std::mutex mutex_
 
std::unordered_map< std::string, std::vector< PooledConnection > > pool_
 

Constructor & Destructor Documentation

◆ ~ConnectionPool()

orbit::network::ConnectionPool::~ConnectionPool ( )

◆ ConnectionPool()

orbit::network::ConnectionPool::ConnectionPool ( )
privatedefault

Member Function Documentation

◆ acquire()

std::pair< int, void * > orbit::network::ConnectionPool::acquire ( const std::string &  host,
int  port 
)

◆ cleanup_stale_connections()

void orbit::network::ConnectionPool::cleanup_stale_connections ( )

◆ get_instance()

static ConnectionPool & orbit::network::ConnectionPool::get_instance ( )
inlinestatic

◆ release()

void orbit::network::ConnectionPool::release ( const std::string &  host,
int  port,
int  fd,
void *  ssl = nullptr 
)

Member Data Documentation

◆ mutex_

std::mutex orbit::network::ConnectionPool::mutex_
private

◆ pool_

std::unordered_map<std::string, std::vector<PooledConnection> > orbit::network::ConnectionPool::pool_
private

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