Commit 5b77a41e authored by Martin Sustrik's avatar Martin Sustrik

Throughput tests fixed.

Introduction of subscription forwarding have broken throughput tests.
This patch changes the pattern used in the tests to PUSH/PULL.
Signed-off-by: 's avatarMartin Sustrik <sustrik@250bpm.com>
parent 4b60023b
......@@ -48,7 +48,7 @@ static void *worker (void *ctx_)
int i;
zmq_msg_t msg;
s = zmq_socket (ctx_, ZMQ_PUB);
s = zmq_socket (ctx_, ZMQ_PUSH);
if (!s) {
printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
exit (1);
......@@ -127,18 +127,12 @@ int main (int argc, char *argv [])
return -1;
}
s = zmq_socket (ctx, ZMQ_SUB);
s = zmq_socket (ctx, ZMQ_PULL);
if (!s) {
printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
return -1;
}
rc = zmq_setsockopt (s, ZMQ_SUBSCRIBE , "", 0);
if (rc != 0) {
printf ("error in zmq_setsockopt: %s\n", zmq_strerror (errno));
return -1;
}
rc = zmq_bind (s, "inproc://thr_test");
if (rc != 0) {
printf ("error in zmq_bind: %s\n", zmq_strerror (errno));
......
......@@ -52,18 +52,12 @@ int main (int argc, char *argv [])
return -1;
}
s = zmq_socket (ctx, ZMQ_SUB);
s = zmq_socket (ctx, ZMQ_PULL);
if (!s) {
printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
return -1;
}
rc = zmq_setsockopt (s, ZMQ_SUBSCRIBE , "", 0);
if (rc != 0) {
printf ("error in zmq_setsockopt: %s\n", zmq_strerror (errno));
return -1;
}
// Add your socket options here.
// For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
......
......@@ -50,7 +50,7 @@ int main (int argc, char *argv [])
return -1;
}
s = zmq_socket (ctx, ZMQ_PUB);
s = zmq_socket (ctx, ZMQ_PUSH);
if (!s) {
printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
return -1;
......@@ -88,8 +88,6 @@ int main (int argc, char *argv [])
}
}
zmq_sleep (2);
rc = zmq_close (s);
if (rc != 0) {
printf ("error in zmq_close: %s\n", zmq_strerror (errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment