mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 11:31:56 +01:00
Fix xpub test to set hwm before bind.
This commit is contained in:
@@ -38,7 +38,12 @@ int main (void)
|
|||||||
// Create a publisher
|
// Create a publisher
|
||||||
void *pub = zmq_socket (ctx, ZMQ_PUB);
|
void *pub = zmq_socket (ctx, ZMQ_PUB);
|
||||||
assert (pub);
|
assert (pub);
|
||||||
int rc = zmq_bind (pub, "inproc://soname");
|
|
||||||
|
int hwm = 2000;
|
||||||
|
int rc = zmq_setsockopt(pub, ZMQ_SNDHWM, &hwm, 4);
|
||||||
|
assert(rc == 0);
|
||||||
|
|
||||||
|
rc = zmq_bind (pub, "inproc://soname");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
|
||||||
// set pub socket options
|
// set pub socket options
|
||||||
@@ -46,9 +51,6 @@ int main (void)
|
|||||||
rc = zmq_setsockopt (pub, ZMQ_XPUB_NODROP, &wait, 4);
|
rc = zmq_setsockopt (pub, ZMQ_XPUB_NODROP, &wait, 4);
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
|
||||||
int hwm = 2000;
|
|
||||||
rc = zmq_setsockopt (pub, ZMQ_SNDHWM, &hwm, 4);
|
|
||||||
assert (rc == 0);
|
|
||||||
|
|
||||||
// Create a subscriber
|
// Create a subscriber
|
||||||
void *sub = zmq_socket (ctx, ZMQ_SUB);
|
void *sub = zmq_socket (ctx, ZMQ_SUB);
|
||||||
|
|||||||
Reference in New Issue
Block a user