summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.cpp b/src/options.cpp
index dcbb51d..e644a9b 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -33,6 +33,7 @@ zmq::options_t::options_t () :
use_multicast_loop (true),
sndbuf (0),
rcvbuf (0),
+ type (-1),
requires_in (false),
requires_out (false),
immediate_connect (true)
@@ -137,6 +138,15 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
{
switch (option_) {
+ case ZMQ_TYPE:
+ if (*optvallen_ < sizeof (int)) {
+ errno = EINVAL;
+ return -1;
+ }
+ *((int*) optval_) = type;
+ *optvallen_ = sizeof (int);
+ return 0;
+
case ZMQ_HWM:
if (*optvallen_ < sizeof (uint64_t)) {
errno = EINVAL;