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

@ -24,7 +24,7 @@
#include <rapidjson/document.h> //json header in zmq stream
#pragma GCC diagnostic pop
//#include <zmq.h>
// #include <zmq.h>
class zmq_msg_t;
namespace sls {
@ -38,6 +38,8 @@ namespace sls {
#define DEFAULT_LOW_ZMQ_HWM_BUFFERSIZE (1024 * 1024) // 1MB
#define DEFAULT_ZMQ_BUFFERSIZE (-1) // os default
#define ZMQ_PUBLISHER_IP "0.0.0.0"
/** zmq header structure */
struct zmqHeader {
/** true if incoming data, false if end of acquisition */
@ -98,22 +100,11 @@ class ZmqSocket {
// use this to optimize if optimizing required eg. int value = -1; if
// (zmq_setsockopt(socketDescriptor, ZMQ_LINGER, &value,sizeof(value))) {
// Close();
/**
* Constructor for a client
* Creates socket, context and connects to server
* @param hostname_or_ip hostname or ip of server
* @param portnumber port number
*/
/** Constructor for a subscriber socket */
ZmqSocket(const char *const hostname_or_ip, const uint16_t portnumber);
/**
* Constructor for a server
* Creates socket, context and connects to server
* socket option: keep alive added
* @param portnumber port number
* @param ethip is the ip of the ethernet interface to stream zmq from
*/
ZmqSocket(const uint16_t portnumber, const char *ethip);
/** Constructor for a publisher socket */
ZmqSocket(const uint16_t portnumber);
/** Returns high water mark for outbound messages */
int GetSendHighWaterMark();

View File

@ -181,9 +181,9 @@ class slsDetectorDefs {
int ymin{-1};
int ymax{-1};
ROI() = default;
ROI(int xmin, int xmax) : xmin(xmin), xmax(xmax){};
ROI(int xmin, int xmax) : xmin(xmin), xmax(xmax) {};
ROI(int xmin, int xmax, int ymin, int ymax)
: xmin(xmin), xmax(xmax), ymin(ymin), ymax(ymax){};
: xmin(xmin), xmax(xmax), ymin(ymin), ymax(ymax) {};
constexpr std::array<int, 4> getIntArray() const {
return std::array<int, 4>({xmin, xmax, ymin, ymax});
}
@ -234,7 +234,7 @@ typedef struct {
int x{0};
int y{0};
xy() = default;
xy(int x, int y) : x(x), y(y){};
xy(int x, int y) : x(x), y(y) {};
} __attribute__((packed));
#endif

View File

@ -748,8 +748,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_GET_RECEIVER_FILE_FORMAT: return "F_GET_RECEIVER_FILE_FORMAT";
case F_SET_RECEIVER_STREAMING_PORT: return "F_SET_RECEIVER_STREAMING_PORT";
case F_GET_RECEIVER_STREAMING_PORT: return "F_GET_RECEIVER_STREAMING_PORT";
case F_SET_RECEIVER_STREAMING_SRC_IP: return "F_SET_RECEIVER_STREAMING_SRC_IP";
case F_GET_RECEIVER_STREAMING_SRC_IP: return "F_GET_RECEIVER_STREAMING_SRC_IP";
case F_SET_RECEIVER_STREAMING_SRC_IP: return "F_SET_RECEIVER_STREAMING_SRC_IP - obsolete";
case F_GET_RECEIVER_STREAMING_SRC_IP: return "F_GET_RECEIVER_STREAMING_SRC_IP - obsolete";
case F_SET_RECEIVER_SILENT_MODE: return "F_SET_RECEIVER_SILENT_MODE";
case F_GET_RECEIVER_SILENT_MODE: return "F_GET_RECEIVER_SILENT_MODE";
case F_RESTREAM_STOP_FROM_RECEIVER: return "F_RESTREAM_STOP_FROM_RECEIVER";