const std::string& service);
private:
- /// @brief Preform the actual communication.
+ /// @brief Perform the actual communication.
+ ///
+ /// @todo Use persistent connections (vs. a new connection per call)
+ /// as the HTTP library supports them.
///
/// @param command The command to send.
/// @return The answer.
ConstElementPtr
StdoutControlSocket::configSet(ConstElementPtr config,
const string& service) {
- output_ << "//////////////// "
- << service << " configuration "
- << "////////////////" << endl;
prettyPrint(config, output_);
output_ << endl;
return (createAnswer());
EXPECT_EQ("{ \"result\": 0 }", answer->str());
// Check output.
- string expected = "//////////////// foo configuration ////////////////\n"
- "{\n \"bar\": 1\n}\n";
+ string expected = "{\n \"bar\": 1\n}\n";
EXPECT_EQ(expected, os.str());
}
ConstElementPtr
UnixControlSocket::sendCommand(ConstElementPtr command) {
+ // We are using our own IO service because this method is synchronous.
IOServicePtr io_service(new IOService());
ClientConnection conn(*io_service);
boost::system::error_code received_ec;
const std::string& service);
private:
- /// @brief Preform the actual communication.
+ /// @brief Perform the actual communication.
+ ///
+ /// @note This method is synchronous, i.e. it blocks until it finishes
+ /// and returns.
///
/// @param command The command to send.
/// @return The answer.