![]() |
Kea 2.7.9
|
Implementation of the UnixCommandMgr
.
More...
Public Member Functions | |
UnixCommandMgrImpl () | |
Constructor. | |
void | closeCommandSocket (UnixSocketInfoPtr info) |
Shuts down any open unix control sockets. | |
void | closeCommandSockets (bool remove=true) |
Shuts down any open unix control sockets. | |
void | doAccept (UnixSocketInfoPtr info) |
Asynchronously accepts next connection. | |
int | getControlSocketFD (UnixSocketInfoPtr info) |
Returns unix control socket descriptor. | |
void | openCommandSocket (const isc::data::ConstElementPtr config) |
Opens acceptor service allowing the control clients to connect. | |
void | openCommandSockets (const isc::data::ConstElementPtr config) |
Opens acceptor service allowing the control clients to connect. | |
Public Attributes | |
ConnectionPool | connection_pool_ |
Pool of connections. | |
IOServicePtr | io_service_ |
Pointer to the IO service used by the server process for running asynchronous tasks. | |
std::map< std::string, UnixSocketInfoPtr > | sockets_ |
The UNIX socket data (configuration, acceptor, etc.). | |
long | timeout_ |
Connection timeout. | |
bool | use_external_ |
Use external sockets flag. | |
Implementation of the UnixCommandMgr
.
Definition at line 496 of file unix_command_mgr.cc.
|
inline |
Constructor.
Definition at line 500 of file unix_command_mgr.cc.
void isc::config::UnixCommandMgrImpl::closeCommandSocket | ( | UnixSocketInfoPtr | info | ) |
Shuts down any open unix control sockets.
info | Configuration information for the unix control socket. |
Definition at line 659 of file unix_command_mgr.cc.
References closeCommandSockets(), connection_pool_, isc::dhcp::IfaceMgr::deleteExternalSocket(), isc::db::info, isc::dhcp::IfaceMgr::instance(), io_service_, sockets_, and use_external_.
Referenced by closeCommandSockets(), and openCommandSockets().
void isc::config::UnixCommandMgrImpl::closeCommandSockets | ( | bool | remove = true | ) |
Shuts down any open unix control sockets.
remove | When true remove the listeners immediately. |
Definition at line 694 of file unix_command_mgr.cc.
References closeCommandSocket(), isc::data::copy(), and sockets_.
Referenced by closeCommandSocket().
void isc::config::UnixCommandMgrImpl::doAccept | ( | UnixSocketInfoPtr | info | ) |
Asynchronously accepts next connection.
info | Configuration information for the unix control socket. |
Definition at line 705 of file unix_command_mgr.cc.
References if(), isc::db::info, and io_service_.
Referenced by openCommandSocket().
int isc::config::UnixCommandMgrImpl::getControlSocketFD | ( | UnixSocketInfoPtr | info | ) |
Returns unix control socket descriptor.
This method should be used only in tests.
info | Configuration information for the unix control socket. |
Definition at line 731 of file unix_command_mgr.cc.
References isc::db::info.
void isc::config::UnixCommandMgrImpl::openCommandSocket | ( | const isc::data::ConstElementPtr | config | ) |
Opens acceptor service allowing the control clients to connect.
Creates acceptor, or reuses the existing one.
config | Configuration information for the control socket. |
BadSocketInfo | When socket configuration is invalid. |
SocketError | When socket operation fails. |
Definition at line 591 of file unix_command_mgr.cc.
References isc::dhcp::IfaceMgr::addExternalSocket(), isc::config::COMMAND_ACCEPTOR_START, isc::config::command_logger, doAccept(), isc::dhcp::IfaceMgr::instance(), io_service_, isc_throw, LOG_INFO, sockets_, and use_external_.
Referenced by openCommandSockets().
void isc::config::UnixCommandMgrImpl::openCommandSockets | ( | const isc::data::ConstElementPtr | config | ) |
Opens acceptor service allowing the control clients to connect.
config | Configuration information for the control socket. |
BadSocketInfo | When socket configuration is invalid. |
SocketError | When socket operation fails. |
Definition at line 562 of file unix_command_mgr.cc.
References closeCommandSocket(), isc::data::copy(), isc_throw, isc::data::Element::list, openCommandSocket(), and sockets_.
ConnectionPool isc::config::UnixCommandMgrImpl::connection_pool_ |
Pool of connections.
Definition at line 549 of file unix_command_mgr.cc.
Referenced by closeCommandSocket().
IOServicePtr isc::config::UnixCommandMgrImpl::io_service_ |
Pointer to the IO service used by the server process for running asynchronous tasks.
Definition at line 546 of file unix_command_mgr.cc.
Referenced by closeCommandSocket(), doAccept(), and openCommandSocket().
std::map<std::string, UnixSocketInfoPtr> isc::config::UnixCommandMgrImpl::sockets_ |
The UNIX socket data (configuration, acceptor, etc.).
Definition at line 552 of file unix_command_mgr.cc.
Referenced by closeCommandSocket(), closeCommandSockets(), openCommandSocket(), and openCommandSockets().
long isc::config::UnixCommandMgrImpl::timeout_ |
Connection timeout.
Definition at line 555 of file unix_command_mgr.cc.
bool isc::config::UnixCommandMgrImpl::use_external_ |
Use external sockets flag.
Definition at line 558 of file unix_command_mgr.cc.
Referenced by closeCommandSocket(), and openCommandSocket().