Kea 3.0.0
isc::lease_query::MtLeaseQueryListenerMgr Class Reference

Manages a thread-pool that is used to drive a LeaseQueryListener. More...

#include <mt_lease_query_mgr.h>

Inheritance diagram for isc::lease_query::MtLeaseQueryListenerMgr:

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.

Detailed Description

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.

Note
This class is NOT compatible with Kea core single-threading. It is incumbent upon the owner to ensure the Kea core multi-threading is (or will be) enabled when creating instances of this class.

Definition at line 31 of file mt_lease_query_mgr.h.

Constructor & Destructor Documentation

◆ MtLeaseQueryListenerMgr()

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.

Parameters
addressIP address to listen on for connections.
portTCP port to listen on for connections.
familyprotocol family the manager serves (AF_INET or AF_INET6).
idle_timeoutTimeout after which a TCP connection is closed by the server.
thread_pool_sizeMaximum Number of threads in the thread pool. This implicit dictates the maximum number of connections.
contextTLS context for authenticating connections. Defaults to empty.
connection_filterCallback connections may use to filter connections by their remote endpoint characteristics (e.g. IP address).
max_concurrent_queriesmaximum 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().

Here is the call graph for this function:

◆ ~MtLeaseQueryListenerMgr()

isc::lease_query::MtLeaseQueryListenerMgr::~MtLeaseQueryListenerMgr ( )
virtual

Destructor.

Definition at line 63 of file mt_lease_query_mgr.cc.

References isc::tcp::MtTcpListenerMgr::stop().

Here is the call graph for this function:

Member Function Documentation

◆ listenerFactory()

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.

Parameters
io_serviceIO service to be used by the listener.
server_addressIP address to listen on for connections.
server_portTCP port to listen on for connections.
tls_contextTLS context for authenticating connections.
idle_timeoutTimeout after which a TCP connection is closed by the server.
connection_filterCallback 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().


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