Change NORM to set TTL using MULTICAST_HOPS sockopt (#4552)

* Change NORM to set TTL using MULTICAST_HOPS instead of hard-coding.  Changes default TTL from 255 to 1.
This commit is contained in:
Jeff Weston 2023-05-19 15:53:20 -04:00 committed by GitHub
parent 4d1dccaebd
commit eaaea73bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,10 +133,7 @@ int zmq::norm_engine_t::init (const char *network_, bool send, bool recv)
// There's many other useful NORM options that could be applied here
if (!NormIsUnicastAddress (addr)) {
// These only apply for multicast sessions
//NormSetTTL(norm_session, options.multicast_hops); // ZMQ default is 1
NormSetTTL (
norm_session,
255); // since the ZMQ_MULTICAST_HOPS socket option isn't well-supported
NormSetTTL (norm_session, options.multicast_hops);
NormSetRxPortReuse (
norm_session,
true); // port reuse doesn't work for non-connected unicast