summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-24 16:47:33 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-24 16:47:33 +0100
commitbc4a1ce3345f4e5904e4b13c618f90def21256a5 (patch)
tree0e95c952f0a5464f5edb515e7d16644e76515a85 /src/socket_base.cpp
parent507718ee1a56e376c06389c513de3868297fec35 (diff)
ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWM
These new options allow to control the maximum size of the inbound and outbound message pipe separately. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r--src/socket_base.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 374e342..bf873b6 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -377,20 +377,25 @@ int zmq::socket_base_t::connect (const char *addr_)
// The total HWM for an inproc connection should be the sum of
// the binder's HWM and the connector's HWM.
- int hwm;
- if (options.hwm == 0 || peer.options.hwm == 0)
- hwm = 0;
+ int sndhwm;
+ int rcvhwm;
+ if (options.sndhwm == 0 || peer.options.rcvhwm == 0)
+ sndhwm = 0;
else
- hwm = options.hwm + peer.options.hwm;
+ sndhwm = options.sndhwm + peer.options.rcvhwm;
+ if (options.rcvhwm == 0 || peer.options.sndhwm == 0)
+ rcvhwm = 0;
+ else
+ rcvhwm = options.rcvhwm + peer.options.sndhwm;
// Create inbound pipe, if required.
if (options.requires_in)
- create_pipe (this, peer.socket, hwm, &inpipe_reader,
+ create_pipe (this, peer.socket, rcvhwm, &inpipe_reader,
&inpipe_writer);
// Create outbound pipe, if required.
if (options.requires_out)
- create_pipe (peer.socket, this, hwm, &outpipe_reader,
+ create_pipe (peer.socket, this, sndhwm, &outpipe_reader,
&outpipe_writer);
// Attach the pipes to this socket object.
@@ -429,12 +434,12 @@ int zmq::socket_base_t::connect (const char *addr_)
// Create inbound pipe, if required.
if (options.requires_in)
- create_pipe (this, session, options.hwm,
+ create_pipe (this, session, options.rcvhwm,
&inpipe_reader, &inpipe_writer);
// Create outbound pipe, if required.
if (options.requires_out)
- create_pipe (session, this, options.hwm,
+ create_pipe (session, this, options.sndhwm,
&outpipe_reader, &outpipe_writer);
// Attach the pipes to the socket object.