mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-16 18:56:55 +02:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user