mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 17:58:01 +08:00
ZMQ_MCAST_LOOP removed
Multicast loopback is not a real multicast, rather a kernel-space simulation. Moreover, it tends to be rather unreliable and lossy. Removing the option will force users to use transports better suited for the job, such as inproc or ipc. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
f5e6d67948
commit
b45b68ae4a
@ -187,23 +187,6 @@ Default value:: -1
|
||||
Applicable socket types:: all, when using multicast transports
|
||||
|
||||
|
||||
ZMQ_MCAST_LOOP: Control multicast loop-back
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_MCAST_LOOP' option controls whether data sent via multicast
|
||||
transports can also be received by the sending host via loop-back. A value of
|
||||
zero indicates that the loop-back functionality is disabled, while the default
|
||||
value of 1 indicates that the loop-back functionality is enabled. Leaving
|
||||
multicast loop-back enabled when it is not required can have a negative impact
|
||||
on performance. Where possible, disable 'ZMQ_MCAST_LOOP' in production
|
||||
environments.
|
||||
|
||||
[horizontal]
|
||||
Option value type:: int64_t
|
||||
Option value unit:: boolean
|
||||
Default value:: 1
|
||||
Applicable socket types:: all, when using multicast transports
|
||||
|
||||
|
||||
ZMQ_SNDBUF: Retrieve kernel transmit buffer size
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_SNDBUF' option shall retrieve the underlying kernel transmit buffer
|
||||
|
@ -23,9 +23,8 @@ UDP datagrams (the 'epgm' transport).
|
||||
The 'pgm' and 'epgm' transports can only be used with the 'ZMQ_PUB' and
|
||||
'ZMQ_SUB' socket types.
|
||||
|
||||
Further, PGM sockets are rate limited by default and incur a performance
|
||||
penalty when used over a loop-back interface. For details, refer to the
|
||||
'ZMQ_RATE', 'ZMQ_RECOVERY_IVL' and 'ZMQ_MCAST_LOOP' options documented in
|
||||
Further, PGM sockets are rate limited by default. For details, refer to the
|
||||
'ZMQ_RATE', and 'ZMQ_RECOVERY_IVL' options documented in
|
||||
linkzmq:zmq_setsockopt[3].
|
||||
|
||||
CAUTION: The 'pgm' transport implementation requires access to raw IP sockets.
|
||||
|
@ -197,23 +197,6 @@ Default value:: -1
|
||||
Applicable socket types:: all, when using multicast transports
|
||||
|
||||
|
||||
ZMQ_MCAST_LOOP: Control multicast loop-back
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_MCAST_LOOP' option shall control whether data sent via multicast
|
||||
transports using the specified 'socket' can also be received by the sending
|
||||
host via loop-back. A value of zero disables the loop-back functionality, while
|
||||
the default value of 1 enables the loop-back functionality. Leaving multicast
|
||||
loop-back enabled when it is not required can have a negative impact on
|
||||
performance. Where possible, disable 'ZMQ_MCAST_LOOP' in production
|
||||
environments.
|
||||
|
||||
[horizontal]
|
||||
Option value type:: int64_t
|
||||
Option value unit:: boolean
|
||||
Default value:: 1
|
||||
Applicable socket types:: all, when using multicast transports
|
||||
|
||||
|
||||
ZMQ_SNDBUF: Set kernel transmit buffer size
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size
|
||||
|
@ -191,7 +191,6 @@ ZMQ_EXPORT int zmq_term (void *context);
|
||||
#define ZMQ_UNSUBSCRIBE 7
|
||||
#define ZMQ_RATE 8
|
||||
#define ZMQ_RECOVERY_IVL 9
|
||||
#define ZMQ_MCAST_LOOP 10
|
||||
#define ZMQ_SNDBUF 11
|
||||
#define ZMQ_RCVBUF 12
|
||||
#define ZMQ_RCVMORE 13
|
||||
|
@ -32,7 +32,6 @@ zmq::options_t::options_t () :
|
||||
rate (100),
|
||||
recovery_ivl (10),
|
||||
recovery_ivl_msec (-1),
|
||||
use_multicast_loop (true),
|
||||
sndbuf (0),
|
||||
rcvbuf (0),
|
||||
type (-1),
|
||||
@ -113,21 +112,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
recovery_ivl_msec = (int32_t) *((int64_t*) optval_);
|
||||
return 0;
|
||||
|
||||
case ZMQ_MCAST_LOOP:
|
||||
if (optvallen_ != sizeof (int64_t)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
if ((int64_t) *((int64_t*) optval_) == 0)
|
||||
use_multicast_loop = false;
|
||||
else if ((int64_t) *((int64_t*) optval_) == 1)
|
||||
use_multicast_loop = true;
|
||||
else {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case ZMQ_SNDBUF:
|
||||
if (optvallen_ != sizeof (uint64_t)) {
|
||||
errno = EINVAL;
|
||||
@ -266,15 +250,6 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
|
||||
*optvallen_ = sizeof (int64_t);
|
||||
return 0;
|
||||
|
||||
case ZMQ_MCAST_LOOP:
|
||||
if (*optvallen_ < sizeof (int64_t)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
*((int64_t*) optval_) = use_multicast_loop ? 1 : 0;
|
||||
*optvallen_ = sizeof (int64_t);
|
||||
return 0;
|
||||
|
||||
case ZMQ_SNDBUF:
|
||||
if (*optvallen_ < sizeof (uint64_t)) {
|
||||
errno = EINVAL;
|
||||
|
@ -48,9 +48,6 @@ namespace zmq
|
||||
// Reliability time interval [ms]. Default -1 = not used.
|
||||
int32_t recovery_ivl_msec;
|
||||
|
||||
// Enable multicast loopback. Default disabled (false).
|
||||
bool use_multicast_loop;
|
||||
|
||||
uint64_t sndbuf;
|
||||
uint64_t rcvbuf;
|
||||
|
||||
|
@ -322,7 +322,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
|
||||
// Set IP level parameters.
|
||||
{
|
||||
const int nonblocking = 1,
|
||||
multicast_loop = options.use_multicast_loop ? 1 : 0,
|
||||
multicast_loop = 0,
|
||||
multicast_hops = 16,
|
||||
|
||||
// Expedited Forwarding PHB for network elements, no ECN.
|
||||
|
Loading…
x
Reference in New Issue
Block a user