summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perf/inproc_thr.cpp10
-rw-r--r--perf/local_thr.cpp8
-rw-r--r--perf/remote_thr.cpp4
3 files changed, 4 insertions, 18 deletions
diff --git a/perf/inproc_thr.cpp b/perf/inproc_thr.cpp
index 0fa32f5..4673eba 100644
--- a/perf/inproc_thr.cpp
+++ b/perf/inproc_thr.cpp
@@ -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));
diff --git a/perf/local_thr.cpp b/perf/local_thr.cpp
index b5379d8..a21707f 100644
--- a/perf/local_thr.cpp
+++ b/perf/local_thr.cpp
@@ -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.
diff --git a/perf/remote_thr.cpp b/perf/remote_thr.cpp
index 363ae7c..c8df333 100644
--- a/perf/remote_thr.cpp
+++ b/perf/remote_thr.cpp
@@ -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));