Kea
1.9.9-git
|
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... | |
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.
Definition at line 32 of file cmd_http_listener.h.
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.
|
virtual |
Destructor.
Definition at line 35 of file cmd_http_listener.cc.
References stop().
|
inline |
Fetches the IP address on which to listen.
Definition at line 78 of file cmd_http_listener.h.
|
inline |
Fetches the port number on which to listen.
Definition at line 85 of file cmd_http_listener.h.
|
inline |
Fetches the number of threads in the pool.
Definition at line 99 of file cmd_http_listener.h.
|
inline |
Fetches a pointer to the internal IOService used to drive the thread-pool in multi-threaded mode.
Definition at line 112 of file cmd_http_listener.h.
|
inline |
Fetches 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.
Definition at line 143 of file cmd_http_listener.cc.
bool isc::config::CmdHttpListener::isRunning | ( | ) |
Indicates if the thread pool is running.
Definition at line 125 of file cmd_http_listener.cc.
bool isc::config::CmdHttpListener::isStopped | ( | ) |
Indicates if the thread pool is stopped.
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 | ( | ) |
Starts running the listener's thread pool.
Definition at line 40 of file cmd_http_listener.cc.
References isc::config::COMMAND_HTTP_LISTENER_STARTED, isc::config::command_logger, isc::config::DBG_COMMAND, isc_throw, isStopped(), LOG_DEBUG, isc::config::TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT, isc::config::TIMEOUT_AGENT_RECEIVE_COMMAND, and isc::Exception::what().
void isc::config::CmdHttpListener::stop | ( | ) |
Stops the listener's thread pool.
Definition at line 100 of file cmd_http_listener.cc.
References isc::config::COMMAND_HTTP_LISTENER_STOPPED, isc::config::COMMAND_HTTP_LISTENER_STOPPING, isc::config::command_logger, isc::config::DBG_COMMAND, and LOG_DEBUG.
Referenced by ~CmdHttpListener().