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

@ -168,8 +168,6 @@ int ClientInterface::functionTable(){
flist[F_GET_RECEIVER_FILE_FORMAT] = &ClientInterface::get_file_format;
flist[F_SET_RECEIVER_STREAMING_PORT] = &ClientInterface::set_streaming_port;
flist[F_GET_RECEIVER_STREAMING_PORT] = &ClientInterface::get_streaming_port;
flist[F_SET_RECEIVER_STREAMING_SRC_IP] = &ClientInterface::set_streaming_source_ip;
flist[F_GET_RECEIVER_STREAMING_SRC_IP] = &ClientInterface::get_streaming_source_ip;
flist[F_SET_RECEIVER_SILENT_MODE] = &ClientInterface::set_silent_mode;
flist[F_GET_RECEIVER_SILENT_MODE] = &ClientInterface::get_silent_mode;
flist[F_RESTREAM_STOP_FROM_RECEIVER] = &ClientInterface::restream_stop;
@ -1084,21 +1082,6 @@ int ClientInterface::get_streaming_port(Interface &socket) {
return socket.sendResult(retval);
}
int ClientInterface::set_streaming_source_ip(Interface &socket) {
auto ip = socket.Receive<IpAddr>();
if (ip == 0)
throw RuntimeError("Invalid zmq ip " + ip.str());
verifyIdle(socket);
impl()->setStreamingSourceIP(ip);
return socket.Send(OK);
}
int ClientInterface::get_streaming_source_ip(Interface &socket) {
IpAddr retval = impl()->getStreamingSourceIP();
LOG(logDEBUG1) << "streaming IP:" << retval;
return socket.sendResult(retval);
}
int ClientInterface::set_silent_mode(Interface &socket) {
auto value = socket.Receive<int>();
if (value < 0) {

View File

@ -117,8 +117,6 @@ class ClientInterface : private virtual slsDetectorDefs {
int get_file_format(ServerInterface &socket);
int set_streaming_port(ServerInterface &socket);
int get_streaming_port(ServerInterface &socket);
int set_streaming_source_ip(ServerInterface &socket);
int get_streaming_source_ip(ServerInterface &socket);
int set_silent_mode(ServerInterface &socket);
int get_silent_mode(ServerInterface &socket);
int restream_stop(ServerInterface &socket);

View File

@ -84,11 +84,10 @@ void DataStreamer::RecordFirstIndex(uint64_t fnum, size_t firstImageIndex) {
<< ", First Streamer Index:" << fnum;
}
void DataStreamer::CreateZmqSockets(uint16_t port, const IpAddr ip, int hwm) {
void DataStreamer::CreateZmqSockets(uint16_t port, int hwm) {
uint16_t portnum = port + index;
std::string sip = ip.str();
try {
zmqSocket = new ZmqSocket(portnum, (ip != 0 ? sip.c_str() : nullptr));
zmqSocket = new ZmqSocket(portnum);
// set if custom
if (hwm >= 0) {

View File

@ -45,10 +45,9 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
* Creates Zmq Sockets
* (throws an exception if it couldnt create zmq sockets)
* @param port streaming port start index
* @param ip streaming source ip
* @param hwm streaming high water mark
*/
void CreateZmqSockets(uint16_t port, const IpAddr ip, int hwm);
void CreateZmqSockets(uint16_t port, int hwm);
void CloseZmqSocket();
void RestreamStop();

View File

@ -210,8 +210,7 @@ void Implementation::SetupDataProcessor(int i) {
void Implementation::SetupDataStreamer(int i) {
dataStreamer[i]->SetFifo(fifo[i].get());
dataStreamer[i]->SetGeneralData(generalData);
dataStreamer[i]->CreateZmqSockets(streamingPort, streamingSrcIP,
streamingHwm);
dataStreamer[i]->CreateZmqSockets(streamingPort, streamingHwm);
dataStreamer[i]->SetAdditionalJsonHeader(additionalJsonHeader);
dataStreamer[i]->SetFileIndex(fileIndex);
dataStreamer[i]->SetQuadEnable(quadEnable);
@ -1262,13 +1261,6 @@ void Implementation::setStreamingPort(const uint16_t i) {
LOG(logINFO) << "Streaming Port: " << streamingPort;
}
IpAddr Implementation::getStreamingSourceIP() const { return streamingSrcIP; }
void Implementation::setStreamingSourceIP(const IpAddr ip) {
streamingSrcIP = ip;
LOG(logINFO) << "Streaming Source IP: " << streamingSrcIP;
}
int Implementation::getStreamingHwm() const { return streamingHwm; }
void Implementation::setStreamingHwm(const int i) {

View File

@ -142,8 +142,6 @@ class Implementation : private virtual slsDetectorDefs {
void setStreamingStartingFrameNumber(const uint32_t fnum);
uint16_t getStreamingPort() const;
void setStreamingPort(const uint16_t i);
IpAddr getStreamingSourceIP() const;
void setStreamingSourceIP(const IpAddr ip);
int getStreamingHwm() const;
void setStreamingHwm(const int i);
std::map<std::string, std::string> getAdditionalJsonHeader() const;
@ -346,7 +344,6 @@ class Implementation : private virtual slsDetectorDefs {
uint32_t streamingTimerInMs{DEFAULT_STREAMING_TIMER_IN_MS};
uint32_t streamingStartFnum{0};
uint16_t streamingPort{0};
IpAddr streamingSrcIP = IpAddr{};
int streamingHwm{-1};
std::map<std::string, std::string> additionalJsonHeader;