diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-14 11:25:57 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-09-14 11:25:57 +0200 |
commit | c806aabb2d3e6b1ba9e3f61319f23d45c7f9a007 (patch) | |
tree | fb44aa2fba39f972b5d04eba7cda7dc310d4b188 /src | |
parent | 36707529a7d82b164b59d42fe0d5d8a35c3dd279 (diff) |
java binding sets socket options using setsockopt function
Diffstat (limited to 'src')
-rw-r--r-- | src/options.cpp | 5 | ||||
-rw-r--r-- | src/options.hpp | 1 | ||||
-rw-r--r-- | src/socket_base.cpp | 16 |
3 files changed, 6 insertions, 16 deletions
diff --git a/src/options.cpp b/src/options.cpp index 804cb4f..a39d312 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -23,9 +23,8 @@ zmq::options_t::options_t () : hwm (0), lwm (0), swap (0), - mask (0), affinity (0), - rate (0), - recovery_ivl (0) + rate (100), + recovery_ivl (10) { } diff --git a/src/options.hpp b/src/options.hpp index 9f4a264..4d359e3 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -34,7 +34,6 @@ namespace zmq int64_t hwm; int64_t lwm; int64_t swap; - uint64_t mask; uint64_t affinity; std::string identity; diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 9412d67..0429726 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -125,14 +125,6 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_, options.swap = *((int64_t*) optval_); return 0; - case ZMQ_MASK: - if (optvallen_ != sizeof (int64_t)) { - errno = EINVAL; - return -1; - } - options.mask = (uint64_t) *((int64_t*) optval_); - return 0; - case ZMQ_AFFINITY: if (optvallen_ != sizeof (int64_t)) { errno = EINVAL; @@ -151,19 +143,19 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_, return -1; case ZMQ_RATE: - if (optvallen_ != sizeof (uint32_t)) { + if (optvallen_ != sizeof (int64_t)) { errno = EINVAL; return -1; } - options.rate = *((int32_t*) optval_); + options.rate = (uint32_t) *((int64_t*) optval_); return 0; case ZMQ_RECOVERY_IVL: - if (optvallen_ != sizeof (uint32_t)) { + if (optvallen_ != sizeof (int64_t)) { errno = EINVAL; return -1; } - options.recovery_ivl = *((int32_t*) optval_); + options.recovery_ivl = (uint32_t) *((int64_t*) optval_); return 0; default: |