Dev/zmq stream all ipv6 adn remove rx_zmqip (#958)

* enable ipv6 in zmq socket

* removed rx_zmqip API and field in gui, changed client updaterxrzip to updateclientzmqip to have the rx_hostname ip if 0. 

* updated command line for rx_zmqip to give a warning. 

* Replaced 'depreciated' to 'deprecated' everywhere

* switching from * to 0.0.0.0 works for rebinding zmq sockets

* fixed help in command line for rx_zmqip * to 0.0.0.0 and removed cmd in python

* remove publisher zmq socket ip also for moench post processing

* fixed tests

* publisher zmq ip macros to be reused
This commit is contained in:
2024-09-10 15:19:08 +02:00
committed by GitHub
parent 15e8c0d9f1
commit e848293916
35 changed files with 168 additions and 426 deletions

View File

@ -1,4 +1,5 @@
#include "Caller.h"
#include "sls/ZmqSocket.h"
#include "sls/bit_utils.h"
#include "sls/file_utils.h"
#include "sls/logger.h"
@ -22,7 +23,7 @@ void Caller::call(const std::string &command,
std::string temp;
while (temp != cmd) {
temp = cmd;
ReplaceIfDepreciated(cmd);
ReplaceIfDeprecated(cmd);
}
det_id = detector_id;
@ -37,9 +38,9 @@ void Caller::call(const std::string &command,
}
}
bool Caller::ReplaceIfDepreciated(std::string &command) {
auto d_it = depreciated_functions.find(command);
if (d_it != depreciated_functions.end()) {
bool Caller::ReplaceIfDeprecated(std::string &command) {
auto d_it = deprecated_functions.find(command);
if (d_it != deprecated_functions.end()) {
// insert old command into arguments (for dacs)
if (d_it->second == "dac") {
@ -648,6 +649,25 @@ std::string Caller::rx_hostname(int action) {
}
return os.str();
}
std::string Caller::rx_zmqip(int action) {
std::string helpMessage =
"\n\t[deprecated] The receiver zmq socket (publisher) will "
"listen to all interfaces ('tcp://0.0.0.0:[port]'to all interfaces "
"(from v9.0.0). This command does nothing and will be removed "
"(from v10.0.0). This change makes no difference to the user.\n";
std::ostringstream os;
if (action == defs::HELP_ACTION) {
os << helpMessage << '\n';
} else if (action == defs::GET_ACTION) {
os << ZMQ_PUBLISHER_IP << '\n';
} else if (action == defs::PUT_ACTION) {
LOG(logWARNING) << helpMessage << '\n';
os << ZMQ_PUBLISHER_IP << '\n';
} else {
throw RuntimeError("Unknown action");
}
return os.str();
}
std::string Caller::rx_roi(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {