23 #include <zmqpp/curve.hpp>
28 const std::string &pubkey)
33 INFO(
"Creating GetRemoteConfigVersion task. Guid = " <<
get_guid());
39 zmqpp::socket sock(ctx, zmqpp::socket_type::dealer);
40 auto kp = zmqpp::curve::generate_keypair();
42 sock.set(zmqpp::socket_option::curve_secret_key, kp.secret_key);
43 sock.set(zmqpp::socket_option::curve_public_key, kp.public_key);
44 sock.set(zmqpp::socket_option::curve_server_key, pubkey_);
45 sock.set(zmqpp::socket_option::linger, 0);
46 sock.connect(endpoint_);
48 sock.send(
"CONFIG_VERSION");
50 zmqpp::message response;
55 if (p.has_input(sock))
57 sock.receive(response);
58 response >> config_version_;
59 INFO(
"Remote configuration version = " << config_version_);
62 ERROR(
"Failed to receive response from remote server in due time");