diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-01-15 08:22:09 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-01-15 08:22:09 +0100 |
commit | c7869f8a51d772ad0654df19741ead8bfe50acfe (patch) | |
tree | 1c5b45cb64d15224ba3762a1d932570653bbce3d /contrib/RemoteControl.cpp | |
parent | ac13498dc219c74d8214a314d0341574ada0ceb3 (diff) | |
download | ODR-AudioEnc-c7869f8a51d772ad0654df19741ead8bfe50acfe.tar.gz ODR-AudioEnc-c7869f8a51d772ad0654df19741ead8bfe50acfe.tar.bz2 ODR-AudioEnc-c7869f8a51d772ad0654df19741ead8bfe50acfe.zip |
Common 6b5db53: Update zmq.hpp, TCPReceiveServer, EDI decoder and output
Diffstat (limited to 'contrib/RemoteControl.cpp')
-rw-r--r-- | contrib/RemoteControl.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/contrib/RemoteControl.cpp b/contrib/RemoteControl.cpp index 4adb90c..9ca8d22 100644 --- a/contrib/RemoteControl.cpp +++ b/contrib/RemoteControl.cpp @@ -29,6 +29,7 @@ #include <algorithm> #include "RemoteControl.h" +#include "zmq.hpp" using namespace std; @@ -424,7 +425,7 @@ void RemoteControllerZmq::recv_all(zmq::socket_t& pSocket, std::vector<std::stri bool more = true; do { zmq::message_t msg; - pSocket.recv(&msg); + pSocket.recv(msg); std::string incoming((char*)msg.data(), msg.size()); message.push_back(incoming); more = msg.more(); @@ -436,7 +437,7 @@ void RemoteControllerZmq::send_ok_reply(zmq::socket_t &pSocket) zmq::message_t msg(2); char repCode[2] = {'o', 'k'}; memcpy ((void*) msg.data(), repCode, 2); - pSocket.send(msg, 0); + pSocket.send(msg, zmq::send_flags::none); } void RemoteControllerZmq::send_fail_reply(zmq::socket_t &pSocket, const std::string &error) @@ -444,11 +445,11 @@ void RemoteControllerZmq::send_fail_reply(zmq::socket_t &pSocket, const std::str zmq::message_t msg1(4); char repCode[4] = {'f', 'a', 'i', 'l'}; memcpy ((void*) msg1.data(), repCode, 4); - pSocket.send(msg1, ZMQ_SNDMORE); + pSocket.send(msg1, zmq::send_flags::sndmore); zmq::message_t msg2(error.length()); memcpy ((void*) msg2.data(), error.c_str(), error.length()); - pSocket.send(msg2, 0); + pSocket.send(msg2, zmq::send_flags::none); } void RemoteControllerZmq::process() @@ -508,8 +509,7 @@ void RemoteControllerZmq::process() zmq::message_t zmsg(ss.str().size()); memcpy ((void*) zmsg.data(), msg_s.data(), msg_s.size()); - int flag = (--cohort_size > 0) ? ZMQ_SNDMORE : 0; - repSocket.send(zmsg, flag); + repSocket.send(zmsg, (--cohort_size > 0) ? zmq::send_flags::sndmore : zmq::send_flags::none); } } else if (msg.size() == 2 && command == "show") { @@ -523,8 +523,7 @@ void RemoteControllerZmq::process() zmq::message_t zmsg(ss.str().size()); memcpy(zmsg.data(), ss.str().data(), ss.str().size()); - int flag = (--r_size > 0) ? ZMQ_SNDMORE : 0; - repSocket.send(zmsg, flag); + repSocket.send(zmsg, (--r_size > 0) ? zmq::send_flags::sndmore : zmq::send_flags::none); } } catch (const ParameterError &err) { @@ -539,7 +538,7 @@ void RemoteControllerZmq::process() std::string value = rcs.get_param(module, parameter); zmq::message_t zmsg(value.size()); memcpy ((void*) zmsg.data(), value.data(), value.size()); - repSocket.send(zmsg, 0); + repSocket.send(zmsg, zmq::send_flags::none); } catch (const ParameterError &err) { send_fail_reply(repSocket, err.what()); @@ -576,4 +575,3 @@ void RemoteControllerZmq::process() } #endif - |