From 6c3c8f24503b654c07e1a8452393263b4bd62614 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 3 Jul 2015 07:59:25 +0200 Subject: update zmq.hpp to support zmq 4.1.x --- src/zmq.hpp | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/zmq.hpp b/src/zmq.hpp index 147f096..eb5416e 100644 --- a/src/zmq.hpp +++ b/src/zmq.hpp @@ -60,6 +60,15 @@ #define ZMQ_NEW_MONITOR_EVENT_LAYOUT #endif +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) +#define ZMQ_HAS_PROXY_STEERABLE +/* Socket event data */ +typedef struct { + uint16_t event; // id of the event as bitfield + int32_t value ; // value is either error code, fd or reconnect interval +} zmq_event_t; +#endif + // In order to prevent unused variable warnings when building in non-debug // mode use this macro to make assertions. #ifndef NDEBUG @@ -109,7 +118,16 @@ namespace zmq if (rc != 0) throw error_t (); } - + +#ifdef ZMQ_HAS_PROXY_STEERABLE + inline void proxy_steerable (void *frontend, void *backend, void *capture, void *control) + { + int rc = zmq_proxy_steerable (frontend, backend, capture, control); + if (rc != 0) + throw error_t (); + } +#endif + inline void version (int *major_, int *minor_, int *patch_) { zmq_version (major_, minor_, patch_); @@ -254,7 +272,7 @@ namespace zmq } - inline explicit context_t (int io_threads_) + inline explicit context_t (int io_threads_, int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT) { ptr = zmq_ctx_new (); if (ptr == NULL) @@ -262,6 +280,9 @@ namespace zmq int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_); ZMQ_ASSERT (rc == 0); + + rc = zmq_ctx_set (ptr, ZMQ_MAX_SOCKETS, max_sockets_); + ZMQ_ASSERT (rc == 0); } #ifdef ZMQ_HAS_RVALUE_REFS @@ -420,6 +441,13 @@ namespace zmq throw error_t (); } +#ifdef ZMQ_HAS_RVALUE_REFS + inline bool send (message_t &&msg_, int flags_ = 0) + { + return send(msg_, flags_); + } +#endif + inline size_t recv (void *buf_, size_t len_, int flags_ = 0) { int nbytes = zmq_recv (ptr, buf_, len_, flags_); @@ -476,7 +504,15 @@ namespace zmq if (rc == -1 && zmq_errno() == ETERM) break; assert (rc != -1); - zmq_event_t* event = static_cast(zmq_msg_data (&eventMsg)); +#if ZMQ_VERSION_MAJOR >= 4 + const char* data = static_cast(zmq_msg_data(&eventMsg)); + zmq_event_t msgEvent; + memcpy(&msgEvent.event, data, sizeof(uint16_t)); data += sizeof(uint16_t); + memcpy(&msgEvent.value, data, sizeof(int32_t)); + zmq_event_t* event = &msgEvent; +#else + zmq_event_t* event = static_cast(zmq_msg_data(&eventMsg)); +#endif #ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT zmq_msg_t addrMsg; -- cgit v1.2.3 From 382bd0679138ea1a7c73506369a133a91e2220e6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 24 Jul 2015 15:55:12 +0200 Subject: Prepare version v0.5.3 --- ChangeLog | 5 +++++ configure.ac | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c119b10..a1d6853 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ This file contains information about the changes done to the ODR-DabMod in this repository +2015-07-24: Matthias P. Braendli + (v0.5.3) + * odr-dabmod: + Replace zmq.hpp to support version 4.1.x + 2015-04-10: Matthias P. Braendli (v0.5.2) * odr-dabmod: diff --git a/configure.ac b/configure.ac index 821ba1f..9841ac9 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ # along with ODR-DabMod. If not, see . AC_PREREQ(2.59) -AC_INIT([ODR-DabMod], [0.5.2], [matthias.braendli@mpb.li]) +AC_INIT([ODR-DabMod], [0.5.3], [matthias.braendli@mpb.li]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_SYSTEM -- cgit v1.2.3