0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

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>
This commit is contained in:
Steven McCoy 2011-10-04 09:32:02 +02:00 committed by Martin Sustrik
parent 7a10bbe77a
commit cc5d31605f

View File

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