Kea  1.9.9-git
isc::config::CmdHttpListener Class Reference

A multi-threaded HTTP listener that can process API commands requests. More...

#include <cmd_http_listener.h>

Public Member Functions

 CmdHttpListener (const asiolink::IOAddress &address, const uint16_t port, const uint16_t thread_pool_size=1)
 Constructor. More...
 
virtual ~CmdHttpListener ()
 Destructor. More...
 
isc::asiolink::IOAddress getAddress () const
 Fetches the IP address on which to listen. More...
 
uint16_t getPort () const
 Fetches the port number on which to listen. More...
 
uint16_t getThreadCount () const
 Fetches the number of threads in the pool. More...
 
asiolink::IOServicePtr getThreadIOService () const
 Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode. More...
 
uint16_t getThreadPoolSize () const
 Fetches the maximum size of the thread pool. More...
 
bool isPaused ()
 Indicates if the thread pool is paused. More...
 
bool isRunning ()
 Indicates if the thread pool is running. More...
 
bool isStopped ()
 Indicates if the thread pool is stopped. More...
 
void pause ()
 Pauses the listener's thread pool. More...
 
void resume ()
 Resumes running the listener's thread pool. More...
 
void start ()
 Starts running the listener's thread pool. More...
 
void stop ()
 Stops the listener's thread pool. More...
 

Detailed Description

A multi-threaded HTTP listener that can process API commands requests.

This class will listen for Command API client requests on a given IP address and port. It uses its own IOService instance to drive a thread-pool which can service multiple connections concurrently. The number of concurrent connections is currently limited to the configured thread pool size.

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 32 of file cmd_http_listener.h.

Constructor & Destructor Documentation

isc::config::CmdHttpListener::CmdHttpListener ( const asiolink::IOAddress address,
const uint16_t  port,
const uint16_t  thread_pool_size = 1 
)

Constructor.

Definition at line 29 of file cmd_http_listener.cc.

isc::config::CmdHttpListener::~CmdHttpListener ( )
virtual

Destructor.

Definition at line 35 of file cmd_http_listener.cc.

References stop().

+ Here is the call graph for this function:

Member Function Documentation

isc::asiolink::IOAddress isc::config::CmdHttpListener::getAddress ( ) const
inline

Fetches the IP address on which to listen.

Returns
IOAddress containing the address on which to listen.

Definition at line 78 of file cmd_http_listener.h.

uint16_t isc::config::CmdHttpListener::getPort ( ) const
inline

Fetches the port number on which to listen.

Returns
uint16_t containing the port number on which to listen.

Definition at line 85 of file cmd_http_listener.h.

uint16_t isc::config::CmdHttpListener::getThreadCount ( ) const
inline

Fetches the number of threads in the pool.

Returns
uint16_t containing the number of running threads.

Definition at line 99 of file cmd_http_listener.h.

asiolink::IOServicePtr isc::config::CmdHttpListener::getThreadIOService ( ) const
inline

Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode.

Returns
pointer to the IOService instance, or an empty pointer in single-threaded mode.

Definition at line 112 of file cmd_http_listener.h.

uint16_t isc::config::CmdHttpListener::getThreadPoolSize ( ) const
inline

Fetches the maximum size of the thread pool.

Returns
uint16_t containing the maximum size of the thread pool.

Definition at line 92 of file cmd_http_listener.h.

bool isc::config::CmdHttpListener::isPaused ( )

Indicates if the thread pool is paused.

Returns
True if the thread pool exists and it is in the PAUSED state, false otherwise.

Definition at line 143 of file cmd_http_listener.cc.

bool isc::config::CmdHttpListener::isRunning ( )

Indicates if the thread pool is running.

Returns
True if the thread pool exists and it is in the RUNNING state, false otherwise.

Definition at line 125 of file cmd_http_listener.cc.

bool isc::config::CmdHttpListener::isStopped ( )

Indicates if the thread pool is stopped.

Returns
True if the thread pool does not exist or it is in the STOPPED state, false otherwise.

Definition at line 134 of file cmd_http_listener.cc.

Referenced by start().

void isc::config::CmdHttpListener::pause ( )

Pauses the listener's thread pool.

Suspends thread pool event processing.

Definition at line 86 of file cmd_http_listener.cc.

void isc::config::CmdHttpListener::resume ( )

Resumes running the listener's thread pool.

Resumes thread pool event processing.

Definition at line 93 of file cmd_http_listener.cc.

void isc::config::CmdHttpListener::start ( )
void isc::config::CmdHttpListener::stop ( )

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