ZMQ_SNDBUF and ZMQ_RCVBUF honoured in PGM transport

This commit is contained in:
Martin Sustrik
2009-12-14 11:46:30 +01:00
parent 68488215da
commit bd792faa9d

View File

@@ -197,9 +197,14 @@ int zmq::pgm_socket_t::open_transport ()
// Set transport->can_send_data = FALSE. // Set transport->can_send_data = FALSE.
// Note that NAKs are still generated by the transport. // Note that NAKs are still generated by the transport.
rc = pgm_transport_set_recv_only (transport, true, false); rc = pgm_transport_set_recv_only (transport, true, false);
zmq_assert (rc == pgm_ok); zmq_assert (rc == pgm_ok);
if (options.rcvbuf) {
rc = pgm_transport_set_rcvbuf (transport, (int) options.rcvbuf);
if (rc != pgm_ok)
return -1;
}
// Set NAK transmit back-off interval [us]. // Set NAK transmit back-off interval [us].
rc = pgm_transport_set_nak_bo_ivl (transport, 50 * 1000); rc = pgm_transport_set_nak_bo_ivl (transport, 50 * 1000);
zmq_assert (rc == pgm_ok); zmq_assert (rc == pgm_ok);
@@ -260,6 +265,12 @@ int zmq::pgm_socket_t::open_transport ()
rc = pgm_transport_set_send_only (transport, TRUE); rc = pgm_transport_set_send_only (transport, TRUE);
zmq_assert (rc == pgm_ok); zmq_assert (rc == pgm_ok);
if (options.sndbuf) {
rc = pgm_transport_set_sndbuf (transport, (int) options.sndbuf);
if (rc != pgm_ok)
return -1;
}
// Set the size of the send window. // Set the size of the send window.
// Data rate is in [B/s] options.rate is in [kb/s]. // Data rate is in [B/s] options.rate is in [kb/s].
if (options.rate <= 0) { if (options.rate <= 0) {