summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven McCoy <steven.mccoy@miru.hk>2011-10-04 09:32:02 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-10-04 09:32:02 +0200
commitcc5d31605fddc9888f3b30933fbd4ec3272299ab (patch)
tree9d73e0a4b77aa2841b865f88e252b24ee8f2cc9f /src
parent7a10bbe77a31158da0573031f8d6a50812262858 (diff)
Re-add PGM rate limiting
It was accidently lost in commit fcfad5682e, equivalent to commits 2ddb106 & b62dd40 in version 2.1. Changes semantics from TXW_MAX_RATE to ODATA_MAX_RATE. Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
Diffstat (limited to 'src')
-rw-r--r--src/pgm_socket.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp
index 5bf49d0..378370c 100644
--- a/src/pgm_socket.cpp
+++ b/src/pgm_socket.cpp
@@ -222,6 +222,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
goto err_abort;
} else {
const int send_only = 1,
+ max_rte = (int) ((options.rate * 1000) / 8),
txw_max_tpdu = (int) pgm_max_tpdu,
txw_sqns = compute_sqns (txw_max_tpdu),
ambient_spm = pgm_secs (30),
@@ -237,6 +238,8 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_SEND_ONLY,
&send_only, sizeof (send_only)) ||
+ !pgm_setsockopt (sock, IPPROTO_PGM, PGM_ODATA_MAX_RTE,
+ &max_rte, sizeof (max_rte)) ||
!pgm_setsockopt (sock, IPPROTO_PGM, PGM_TXW_SQNS,
&txw_sqns, sizeof (txw_sqns)) ||
!pgm_setsockopt (sock, IPPROTO_PGM, PGM_AMBIENT_SPM,