Kea  1.9.9-git
unix_control_client.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef UNIX_CONTROL_CLIENT_H
8 #define UNIX_CONTROL_CLIENT_H
9 
10 #include <string>
11 
12 namespace isc {
13 namespace dhcp {
14 namespace test {
15 
23 public:
24 
27 
30 
32  void disconnectFromServer();
33 
37  bool connectToServer(const std::string& socket_path);
38 
42  bool sendCommand(const std::string& command);
43 
50  bool getResponse(std::string& response, const unsigned int timeout_sec = 0);
51 
56  int selectCheck(const unsigned int timeout_sec);
57 
60 };
61 
62 }; // end of isc::dhcp::test namespace
63 }; // end of isc::dhcp namespace
64 }; // end of isc namespace
65 
66 #endif // UNIX_CONTROL_CLIENT_H
void disconnectFromServer()
Closes the Control Channel socket.
int selectCheck(const unsigned int timeout_sec)
Uses select to poll the Control Channel for data waiting.
bool connectToServer(const std::string &socket_path)
Connects to a Unix socket at the given path.
Class that acts as a UnixCommandSocket client.
UnixControlClient()
Default constructor.
bool getResponse(std::string &response, const unsigned int timeout_sec=0)
Reads the response text from the open Control Channel.
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool sendCommand(const std::string &command)
Sends the given command across the open Control Channel.
int socket_fd_
Retains the fd of the open socket.