diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/options.cpp | 22 | ||||
| -rw-r--r-- | src/options.hpp | 6 | ||||
| -rw-r--r-- | src/sub.cpp | 4 | 
3 files changed, 9 insertions, 23 deletions
diff --git a/src/options.cpp b/src/options.cpp index aa92f93..be7c4b5 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -38,12 +38,12 @@ zmq::options_t::options_t () :      reconnect_ivl_max (0),      backlog (100),      maxmsgsize (-1), -    filter (1),      rcvtimeo (-1),      sndtimeo (-1),      immediate_connect (true),      delay_on_close (true), -    delay_on_disconnect (true) +    delay_on_disconnect (true), +    filter (false)  {  } @@ -177,15 +177,6 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,          multicast_hops = *((int*) optval_);          return 0; -    case ZMQ_FILTER: -        if (optvallen_ != sizeof (int) || (*((int*) optval_) != 0 && -                *((int*) optval_) != 1)) { -            errno = EINVAL; -            return -1; -        } -        filter = *((int*) optval_); -        return 0; -      case ZMQ_RCVTIMEO:          if (optvallen_ != sizeof (int)) {              errno = EINVAL; @@ -347,15 +338,6 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)          *optvallen_ = sizeof (int);          return 0; -    case ZMQ_FILTER: -        if (*optvallen_ < sizeof (int)) { -            errno = EINVAL; -            return -1; -        } -        *((int*) optval_) = filter; -        *optvallen_ = sizeof (int); -        return 0; -      case ZMQ_RCVTIMEO:          if (*optvallen_ < sizeof (int)) {              errno = EINVAL; diff --git a/src/options.hpp b/src/options.hpp index 70144b2..a4a0bc6 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -75,9 +75,6 @@ namespace zmq          //  Maximal size of message to handle.          int64_t maxmsgsize; -        //  If 1, (X)SUB socket should filter the messages. If 0, it should not. -        int filter; -          // The timeout for send/recv operations for this socket.          int rcvtimeo;          int sndtimeo; @@ -95,6 +92,9 @@ namespace zmq          //  If true, socket reads all the messages from the pipe and delivers          //  them to the user when the peer terminates.          bool delay_on_disconnect; + +        //  If 1, (X)SUB socket should filter the messages. If 0, it should not. +        bool filter;      };  } diff --git a/src/sub.cpp b/src/sub.cpp index c8ffd2e..2a1454a 100644 --- a/src/sub.cpp +++ b/src/sub.cpp @@ -25,6 +25,10 @@ zmq::sub_t::sub_t (class ctx_t *parent_, uint32_t tid_) :      xsub_t (parent_, tid_)  {      options.type = ZMQ_SUB; + +    //  Switch filtering messages on (as opposed to XSUB which where the +    //  filtering is off). +    options.filter = true;  }  zmq::sub_t::~sub_t ()  | 
