![]() |
Kea 3.0.0
|
Manages a thread-pool that is used to drive a LeaseQueryListener. More...
#include <mt_lease_query_mgr.h>
Public Member Functions | |
MtLeaseQueryListenerMgr (const asiolink::IOAddress &address, const uint16_t port, const uint16_t family, const tcp::TcpListener::IdleTimeout &idle_timeout, const uint16_t thread_pool_size=1, asiolink::TlsContextPtr context=asiolink::TlsContextPtr(), tcp::TcpConnectionFilterCallback connection_filter=0, const size_t max_concurrent_queries=0) | |
Constructor. | |
virtual | ~MtLeaseQueryListenerMgr () |
Destructor. | |
tcp::TcpListenerPtr | listenerFactory (const asiolink::IOServicePtr &io_service, const asiolink::IOAddress &server_address, const unsigned short server_port, const asiolink::TlsContextPtr &tls_context, const tcp::TcpListener::IdleTimeout &idle_timeout, const tcp::TcpConnectionFilterCallback &connection_filter) |
Defines a factory function for creating listeners. | |
Public Member Functions inherited from isc::tcp::MtTcpListenerMgr | |
MtTcpListenerMgr (TcpListenerFactory listener_factory, const asiolink::IOAddress &address, const uint16_t port, const uint16_t thread_pool_size=1, asiolink::TlsContextPtr context=asiolink::TlsContextPtr(), TcpConnectionFilterCallback connection_filter=0) | |
Constructor. | |
virtual | ~MtTcpListenerMgr () |
Destructor. | |
void | checkPermissions () |
Check if the current thread can perform thread pool state transition. | |
isc::asiolink::IOAddress | getAddress () const |
Fetches the IP address on which to listen. | |
long | getIdleTimeout () |
uint16_t | getPort () const |
Fetches the port number on which to listen. | |
const TcpListenerPtr | getTcpListener () |
Fetch a pointer to the listener. | |
uint16_t | getThreadCount () const |
Fetches the number of threads in the pool. | |
asiolink::IOServicePtr | getThreadIOService () const |
Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode. | |
uint16_t | getThreadPoolSize () const |
Fetches the maximum size of the thread pool. | |
asiolink::TlsContextPtr | getTlsContext () const |
Fetches the TLS context. | |
bool | isPaused () |
Indicates if the thread pool is paused. | |
bool | isRunning () |
Indicates if the thread pool is running. | |
bool | isStopped () |
Indicates if the thread pool is stopped. | |
void | pause () |
Pauses the listener's thread pool. | |
void | resume () |
Resumes running the listener's thread pool. | |
void | setIdleTimeout (long milliseconds) |
Sets the idle time per connection. | |
void | start () |
Starts running the listener's thread pool. | |
void | stop () |
Stops the listener's thread pool. |
Manages a thread-pool that is used to drive a LeaseQueryListener.
This class manages an IOServiceThreadPool which in turn is used to drive an internal instance of LeaseQueryListener. This allows the listener connections to each run on their own thread within the pool. The pool can be started, paused, resumed, and stopped.
Definition at line 31 of file mt_lease_query_mgr.h.
isc::lease_query::MtLeaseQueryListenerMgr::MtLeaseQueryListenerMgr | ( | const asiolink::IOAddress & | address, |
const uint16_t | port, | ||
const uint16_t | family, | ||
const tcp::TcpListener::IdleTimeout & | idle_timeout, | ||
const uint16_t | thread_pool_size = 1, | ||
asiolink::TlsContextPtr | context = asiolink::TlsContextPtr(), | ||
tcp::TcpConnectionFilterCallback | connection_filter = 0, | ||
const size_t | max_concurrent_queries = 0 ) |
Constructor.
address | IP address to listen on for connections. |
port | TCP port to listen on for connections. |
family | protocol family the manager serves (AF_INET or AF_INET6). |
idle_timeout | Timeout after which a TCP connection is closed by the server. |
thread_pool_size | Maximum Number of threads in the thread pool. This implicit dictates the maximum number of connections. |
context | TLS context for authenticating connections. Defaults to empty. |
connection_filter | Callback connections may use to filter connections by their remote endpoint characteristics (e.g. IP address). |
max_concurrent_queries | maximum number of concurrent queries per connection. Defaults to zero (unlimited). |
Definition at line 26 of file mt_lease_query_mgr.cc.
References MtLeaseQueryListenerMgr(), isc::tcp::MtTcpListenerMgr::MtTcpListenerMgr(), listenerFactory(), isc::tcp::MtTcpListenerMgr::setIdleTimeout(), and isc::tcp::TcpListener::IdleTimeout::value_.
Referenced by MtLeaseQueryListenerMgr().
|
virtual |
Destructor.
Definition at line 63 of file mt_lease_query_mgr.cc.
References isc::tcp::MtTcpListenerMgr::stop().
TcpListenerPtr isc::lease_query::MtLeaseQueryListenerMgr::listenerFactory | ( | const asiolink::IOServicePtr & | io_service, |
const asiolink::IOAddress & | server_address, | ||
const unsigned short | server_port, | ||
const asiolink::TlsContextPtr & | tls_context, | ||
const tcp::TcpListener::IdleTimeout & | idle_timeout, | ||
const tcp::TcpConnectionFilterCallback & | connection_filter ) |
Defines a factory function for creating listeners.
io_service | IO service to be used by the listener. |
server_address | IP address to listen on for connections. |
server_port | TCP port to listen on for connections. |
tls_context | TLS context for authenticating connections. |
idle_timeout | Timeout after which a TCP connection is closed by the server. |
connection_filter | Callback connections may use to filter connections by their remote endpoint characteristics (e.g. ip address) |
Definition at line 45 of file mt_lease_query_mgr.cc.
Referenced by MtLeaseQueryListenerMgr().