diff options
Diffstat (limited to 'src/options.cpp')
-rw-r--r-- | src/options.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/options.cpp b/src/options.cpp index 399fd27..897e0f5 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -29,6 +29,7 @@ zmq::options_t::options_t () : affinity (0), rate (100), recovery_ivl (10000), + multicast_hops (1), sndbuf (0), rcvbuf (0), type (-1), @@ -165,6 +166,14 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, maxmsgsize = *((int64_t*) optval_); return 0; + case ZMQ_MULTICAST_HOPS: + if (optvallen_ != sizeof (int) || *((int*) optval_) <= 0) { + errno = EINVAL; + return -1; + } + multicast_hops = *((int*) optval_); + return 0; + } errno = EINVAL; @@ -301,6 +310,15 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) *optvallen_ = sizeof (int64_t); return 0; + case ZMQ_MULTICAST_HOPS: + if (*optvallen_ < sizeof (int)) { + errno = EINVAL; + return -1; + } + *((int*) optval_) = multicast_hops; + *optvallen_ = sizeof (int); + return 0; + } errno = EINVAL; |