mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
Problem: UDP does not support ZMQ_MULTICAST_HOPS
Solution: add support for ZMQ_MULTICAST_HOPS (IP_MULTICAST_TTL)
This commit is contained in:
parent
7064c3a55f
commit
22083d7d62
@ -149,6 +149,21 @@ void zmq::udp_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_)
|
|||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
#endif
|
#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) {
|
if (out->family () == AF_INET6) {
|
||||||
int bind_if = udp_addr->bind_if ();
|
int bind_if = udp_addr->bind_if ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user