From 2e39f892c353851fe90261db0a0875abab50539f Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 10 Dec 2009 09:47:24 +0100 Subject: ZMQII-27: Allow setting SNDBUF and RCVBUF size from 0MQ API (POSIX) --- src/options.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/options.cpp') diff --git a/src/options.cpp b/src/options.cpp index 120ae7c..3f903cb 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -30,6 +30,8 @@ zmq::options_t::options_t () : rate (100), recovery_ivl (10), use_multicast_loop (true), + sndbuf (0), + rcvbuf (0), requires_in (false), requires_out (false) { @@ -106,6 +108,22 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, return -1; } return 0; + + case ZMQ_SNDBUF: + if (optvallen_ != sizeof (uint64_t)) { + errno = EINVAL; + return -1; + } + sndbuf = *((uint64_t*) optval_); + return 0; + + case ZMQ_RCVBUF: + if (optvallen_ != sizeof (uint64_t)) { + errno = EINVAL; + return -1; + } + rcvbuf = *((uint64_t*) optval_); + return 0; } errno = EINVAL; -- cgit v1.2.3