summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormalosek <malosek@fastmq.com>2009-09-16 12:22:36 +0200
committermalosek <malosek@fastmq.com>2009-09-16 12:22:36 +0200
commit7a5db6041f4f11ed502fa7446da900509dedb00f (patch)
tree6f96beb5f647a3ac296be2f24a2f675880f6b8a7 /src
parent9c522dccaf0b2c8074bd96fbfb4c968f45748ba4 (diff)
added newly added socket options to all language bindings, P2P model changed to PUB/SUB for throughput tests
Diffstat (limited to 'src')
-rw-r--r--src/socket_base.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 10f1404..88ba43f 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -158,11 +158,18 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_,
return 0;
case ZMQ_MCAST_LOOP:
- if (optvallen_ != sizeof (bool)) {
+ if (optvallen_ != sizeof (int64_t)) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if ((int64_t) *((int64_t*) optval_) == 0 ||
+ (int64_t) *((int64_t*) optval_) == 1) {
+ options.use_multicast_loop = (bool) *((int64_t*) optval_);
+ } else {
errno = EINVAL;
return -1;
}
- options.use_multicast_loop = optval_;
return 0;
default: