Initial stab at a context level monitor callback and registration API

This commit is contained in:
Lourens Naudé
2012-05-21 20:47:11 +01:00
parent e13b3723b8
commit 4767159f39
8 changed files with 118 additions and 146 deletions

View File

@@ -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;