Problem: ZMQ doesn't expose the MULTICAST_LOOP socket option

Solution: add a new ZMQ_MULTICAST_LOOP option for UDP sockets.
This commit is contained in:
Lionel Flandrin
2018-05-10 16:56:49 +02:00
parent e9211aed2c
commit 99412c810d
8 changed files with 309 additions and 0 deletions

View File

@@ -232,6 +232,7 @@ zmq::options_t::options_t () :
use_fd (-1),
zap_enforce_domain (false),
loopback_fastpath (false),
multicast_loop (true),
zero_copy (true)
{
memset (curve_public_key, 0, CURVE_KEYSIZE);
@@ -726,6 +727,11 @@ int zmq::options_t::setsockopt (int option_,
errno = EINVAL;
return -1;
break;
case ZMQ_MULTICAST_LOOP:
return do_setsockopt_int_as_bool_relaxed (optval_, optvallen_,
&multicast_loop);
default:
#if defined(ZMQ_ACT_MILITANT)
// There are valid scenarios for probing with unknown socket option
@@ -1120,6 +1126,13 @@ int zmq::options_t::getsockopt (int option_,
}
break;
case ZMQ_MULTICAST_LOOP:
if (is_int) {
*value = multicast_loop;
return 0;
}
break;
default:
#if defined(ZMQ_ACT_MILITANT)
malformed = false;