ZMQII-27: Allow setting SNDBUF and RCVBUF size from 0MQ API (POSIX)

This commit is contained in:
Martin Sustrik
2009-12-10 09:47:24 +01:00
parent 72dacc3570
commit 2e39f892c3
14 changed files with 87 additions and 9 deletions

View File

@@ -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;