implement zmq_unbind(),zmq_disconnect(), zmq->sock->getsockopt(ZMQ_LAST_ENDPOINT_ID)

This commit is contained in:
Sergey KHripchenko
2012-04-18 23:42:11 +04:00
parent b89a53ee7a
commit 7b8e728e43
17 changed files with 231 additions and 49 deletions

View File

@@ -30,6 +30,7 @@ zmq::options_t::options_t () :
rcvhwm (1000),
affinity (0),
identity_size (0),
last_endpoint_id(NULL),
rate (100),
recovery_ivl (10000),
multicast_hops (1),
@@ -529,6 +530,15 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
memcpy (optval_, last_endpoint.c_str(), last_endpoint.size()+1);
*optvallen_ = last_endpoint.size()+1;
return 0;
case ZMQ_LAST_ENDPOINT_ID:
if (*optvallen_ < sizeof (void *)) {
errno = EINVAL;
return -1;
}
*((void **) optval_) = last_endpoint_id;
*optvallen_ = sizeof (void *);
return 0;
}
errno = EINVAL;