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>
This commit is contained in:
Martin Sustrik
2011-03-24 16:47:33 +01:00
parent 507718ee1a
commit bc4a1ce334
8 changed files with 109 additions and 38 deletions

View File

@@ -33,14 +33,14 @@ int main (int argc, char *argv [])
void *sb = zmq_socket (ctx, ZMQ_PULL);
assert (sb);
int hwm = 2;
int rc = zmq_setsockopt (sb, ZMQ_HWM, &hwm, sizeof (hwm));
int rc = zmq_setsockopt (sb, ZMQ_RCVHWM, &hwm, sizeof (hwm));
assert (rc == 0);
rc = zmq_bind (sb, "inproc://a");
assert (rc == 0);
void *sc = zmq_socket (ctx, ZMQ_PUSH);
assert (sc);
rc = zmq_setsockopt (sc, ZMQ_HWM, &hwm, sizeof (hwm));
rc = zmq_setsockopt (sc, ZMQ_SNDHWM, &hwm, sizeof (hwm));
assert (rc == 0);
rc = zmq_connect (sc, "inproc://a");
assert (rc == 0);