Add ability to set and get DSCP socket option

This commit is contained in:
Chris Laws
2013-11-25 13:31:21 +10:30
parent b91ef997ce
commit 38bceca9ca
12 changed files with 389 additions and 11 deletions

View File

@@ -33,6 +33,7 @@ zmq::options_t::options_t () :
multicast_hops (1),
sndbuf (0),
rcvbuf (0),
tos (0),
type (-1),
linger (-1),
reconnect_ivl (100),
@@ -125,6 +126,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break;
case ZMQ_TOS:
if (is_int && value >= 0) {
tos = value;
return 0;
}
break;
case ZMQ_LINGER:
if (is_int && value >= -1) {
linger = value;
@@ -424,6 +432,12 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break;
case ZMQ_TOS:
if (is_int) {
*value = tos;
return 0;
}
break;
case ZMQ_TYPE:
if (is_int) {
*value = type;