mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 03:20:13 +01:00
Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets
This commit is contained in:
@@ -30,6 +30,7 @@ zmq::options_t::options_t () :
|
||||
rcvhwm (1000),
|
||||
affinity (0),
|
||||
identity_size (0),
|
||||
last_endpoint_size(0),
|
||||
rate (100),
|
||||
recovery_ivl (10000),
|
||||
multicast_hops (1),
|
||||
@@ -213,7 +214,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
ipv4only = val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
errno = EINVAL;
|
||||
@@ -385,7 +385,15 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
|
||||
*((int*) optval_) = ipv4only;
|
||||
*optvallen_ = sizeof (int);
|
||||
return 0;
|
||||
|
||||
|
||||
case ZMQ_LAST_ENDPOINT:
|
||||
if (*optvallen_ < last_endpoint_size) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
memcpy (optval_, last_endpoint, last_endpoint_size);
|
||||
*optvallen_ = last_endpoint_size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user