diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-12-14 11:46:30 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-12-14 11:46:30 +0100 |
commit | bd792faa9d6c78c375dbc52c6d773e157335da36 (patch) | |
tree | 25e6da244177812e2b7b081c8aae89c95ccae0d3 /src | |
parent | 68488215da8e03a74ca4da6b822e4cfa3b71d73a (diff) |
ZMQ_SNDBUF and ZMQ_RCVBUF honoured in PGM transport
Diffstat (limited to 'src')
-rw-r--r-- | src/pgm_socket.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp index 3b67b76..a16acd6 100644 --- a/src/pgm_socket.cpp +++ b/src/pgm_socket.cpp @@ -197,9 +197,14 @@ int zmq::pgm_socket_t::open_transport () // Set transport->can_send_data = FALSE. // Note that NAKs are still generated by the transport. rc = pgm_transport_set_recv_only (transport, true, false); - 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]. rc = pgm_transport_set_nak_bo_ivl (transport, 50 * 1000); zmq_assert (rc == pgm_ok); @@ -260,6 +265,12 @@ int zmq::pgm_socket_t::open_transport () rc = pgm_transport_set_send_only (transport, TRUE); 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. // Data rate is in [B/s] options.rate is in [kb/s]. if (options.rate <= 0) { |