Unverified Commit 3863c869 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #3284 from lhftio/udp-multicast-hops

Add support for UDP multicast ttl (ZMQ_MULTICAST_HOPS)
parents 7064c3a5 4ce40268
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Conrad Parker that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "kfish", with
commit author "Conrad Parker <conrad@metadecks.org>", are
copyright of Conrad Parker. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Conrad Parker
2018/10/30
......@@ -149,6 +149,21 @@ void zmq::udp_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_)
errno_assert (rc == 0);
#endif
int hops = _options.multicast_hops;
if (hops > 0) {
rc = setsockopt (_fd, level, IP_MULTICAST_TTL,
reinterpret_cast<char *> (&hops),
sizeof (hops));
} else {
rc = 0;
}
#ifdef ZMQ_HAVE_WINDOWS
wsa_assert (rc != SOCKET_ERROR);
#else
errno_assert (rc == 0);
#endif
if (out->family () == AF_INET6) {
int bind_if = udp_addr->bind_if ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment