59 boost::system::error_code received_ec;
64 [&io_service, &received_ec, &received_feed]
71 io_service->stopWork();
81 << received_ec.message());
86 isc_throw(ControlSocketError,
"empty response");
90 return (received_feed->toElement());
91 }
catch (exception
const& ex) {
92 isc_throw(ControlSocketError,
"unparsable response: " << ex.what());
The IOService class is a wrapper for the ASIO io_service class.
Represents client side connection over the unix domain socket.
Base class for control socket communication.
const std::string getName() const
Returns the Unix socket name.
Exception thrown when the error during communication.
Class for control socket communication over UNIX socket.
data::ConstElementPtr configTest(data::ElementPtr config, const std::string &service) override final
Test configuration.
UnixControlSocket(CfgControlSocketPtr ctrl_sock)
Constructor.
data::ConstElementPtr configGet(const std::string &service) override final
Get configuration.
data::ConstElementPtr configSet(data::ElementPtr config, const std::string &service) override final
Set configuration.
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
boost::shared_ptr< const JSONFeed > ConstJSONFeedPtr
Pointer to the const JSONFeed.
ConstElementPtr createCommand(const std::string &command)
Creates a standard command message with no argument (of the form { "command": "my_command" }...
constexpr long TIMEOUT_AGENT_FORWARD_COMMAND
Timeout for the Control Agent to forward command to a Kea server, e.g.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::shared_ptr< ControlSocketBase > ControlSocketBasePtr
Type definition for the pointer to the ControlSocketBase.
ControlSocketBasePtr createControlSocket< CfgControlSocket::Type::UNIX >(CfgControlSocketPtr ctrl_sock)
Factory template specialization for unix control sockets.
std::shared_ptr< CfgControlSocket > CfgControlSocketPtr
Defines a pointer for CfgControlSocket instances.
std::shared_ptr< UnixControlSocket > UnixControlSocketPtr
Type definition for the pointer to the UnixControlSocket.
Defines the logger used by the top-level component of kea-lfc.
Encapsulates control command.
Encapsulates socket path.
Encapsulates timeout value.
Contains declarations for UNIX control socket communication.