From a2252de2bcecb672f09c8a5d0013cce23d1d404f Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 24 Mar 2011 14:36:40 +0100 Subject: ZMQ_RECOVERY_IVL and ZMQ_RECOVERY_IVL_MSEC reconciled There's only one option now -- ZMQ_RECOVRY_IVL -- and it's measured in milliseconds. Signed-off-by: Martin Sustrik --- src/options.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/options.cpp') diff --git a/src/options.cpp b/src/options.cpp index 9916475..a053048 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -29,8 +29,7 @@ zmq::options_t::options_t () : hwm (0), affinity (0), rate (100), - recovery_ivl (10), - recovery_ivl_msec (-1), + recovery_ivl (10000), sndbuf (0), rcvbuf (0), type (-1), @@ -80,7 +79,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, return 0; case ZMQ_RATE: - if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) { + if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) <= 0) { errno = EINVAL; return -1; } @@ -95,14 +94,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, recovery_ivl = (uint32_t) *((int64_t*) optval_); return 0; - case ZMQ_RECOVERY_IVL_MSEC: - if (optvallen_ != sizeof (int64_t) || *((int64_t*) optval_) < 0) { - errno = EINVAL; - return -1; - } - recovery_ivl_msec = (int32_t) *((int64_t*) optval_); - return 0; - case ZMQ_SNDBUF: if (optvallen_ != sizeof (uint64_t)) { errno = EINVAL; @@ -223,15 +214,6 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) *optvallen_ = sizeof (int64_t); return 0; - case ZMQ_RECOVERY_IVL_MSEC: - if (*optvallen_ < sizeof (int64_t)) { - errno = EINVAL; - return -1; - } - *((int64_t*) optval_) = recovery_ivl_msec; - *optvallen_ = sizeof (int64_t); - return 0; - case ZMQ_SNDBUF: if (*optvallen_ < sizeof (uint64_t)) { errno = EINVAL; -- cgit v1.2.3