mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 03:20:13 +01:00
Initial stab at a context level monitor callback and registration API
This commit is contained in:
@@ -53,7 +53,6 @@ zmq::options_t::options_t () :
|
||||
tcp_keepalive_cnt (-1),
|
||||
tcp_keepalive_idle (-1),
|
||||
tcp_keepalive_intvl (-1),
|
||||
monitor (NULL),
|
||||
socket_id (0)
|
||||
{
|
||||
}
|
||||
@@ -314,20 +313,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
case ZMQ_MONITOR:
|
||||
{
|
||||
if (optvallen_ == 0 && optval_ == NULL) {
|
||||
monitor = NULL;
|
||||
return 0;
|
||||
}
|
||||
if (optvallen_ != sizeof (void *)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
monitor = *((zmq_monitor**) &optval_);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@@ -544,15 +529,6 @@ 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_MONITOR:
|
||||
if (*optvallen_ < sizeof (void *)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
*((zmq_monitor**) &optval_) = monitor;
|
||||
*optvallen_ = sizeof (zmq_monitor*);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user