Fix xpub test to set hwm before bind.

This commit is contained in:
Richard Newton 2015-06-05 12:19:48 +01:00
parent d4b11b0d17
commit dc105ffc78

View File

@ -38,7 +38,12 @@ int main (void)
// Create a publisher
void *pub = zmq_socket (ctx, ZMQ_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);
// set pub socket options
@ -46,9 +51,6 @@ int main (void)
rc = zmq_setsockopt (pub, ZMQ_XPUB_NODROP, &wait, 4);
assert (rc == 0);
int hwm = 2000;
rc = zmq_setsockopt (pub, ZMQ_SNDHWM, &hwm, 4);
assert (rc == 0);
// Create a subscriber
void *sub = zmq_socket (ctx, ZMQ_SUB);