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

@ -1429,8 +1429,8 @@ void Module::setReceiverHostname(const std::string &hostname,
shm()->numUDPInterfaces = retval.udpInterfaces;
// to use rx_hostname if empty and also update client zmqip
updateReceiverStreamingIP();
// to use rx_hostname if empty
updateClientStreamingIP();
}
uint16_t Module::getReceiverPort() const { return shm()->rxTCPPort; }
@ -1656,21 +1656,6 @@ void Module::setReceiverStreamingPort(uint16_t port) {
sendToReceiver(F_SET_RECEIVER_STREAMING_PORT, port, nullptr);
}
IpAddr Module::getReceiverStreamingIP() const {
return sendToReceiver<IpAddr>(F_GET_RECEIVER_STREAMING_SRC_IP);
}
void Module::setReceiverStreamingIP(const IpAddr ip) {
if (ip == 0) {
throw RuntimeError("Invalid receiver zmq ip address");
}
// if client zmqip is empty, update it
if (shm()->zmqip == 0) {
shm()->zmqip = ip;
}
sendToReceiver(F_SET_RECEIVER_STREAMING_SRC_IP, ip, nullptr);
}
uint16_t Module::getClientStreamingPort() const { return shm()->zmqport; }
void Module::setClientStreamingPort(uint16_t port) { shm()->zmqport = port; }
@ -3613,18 +3598,19 @@ void Module::receiveModule(sls_detector_module *myMod, ClientSocket &client) {
LOG(level) << myMod->nchan << " chans received";
}
void Module::updateReceiverStreamingIP() {
auto ip = getReceiverStreamingIP();
void Module::updateClientStreamingIP() {
auto ip = getClientStreamingIP();
if (ip == 0) {
// Hostname could be ip try to decode otherwise look up the hostname
ip = IpAddr{shm()->rxHostname};
if (ip == 0) {
ip = HostnameToIp(shm()->rxHostname);
}
LOG(logINFO) << "Setting default receiver " << moduleIndex
<< " streaming zmq ip to " << ip;
LOG(logINFO) << "Setting default module " << moduleIndex
<< " zmq ip to " << ip;
setClientStreamingIP(ip);
}
setReceiverStreamingIP(ip);
}
void Module::updateRateCorrection() {