diff options
-rw-r--r-- | src/socket_base.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 9806465..bb8e7c9 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -163,9 +163,14 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_, return -1; } - if ((int64_t) *((int64_t*) optval_) == 0 || - (int64_t) *((int64_t*) optval_) == 1) { - options.use_multicast_loop = (bool) *((int64_t*) optval_); + if ((int64_t) *((int64_t*) optval_) == 0) { + + options.use_multicast_loop = false; + + } else if ((int64_t) *((int64_t*) optval_) == 1) { + + options.use_multicast_loop = true; + } else { errno = EINVAL; return -1; |