diff options
Diffstat (limited to 'perf/c')
| -rw-r--r-- | perf/c/local_lat.c | 11 | ||||
| -rw-r--r-- | perf/c/local_thr.c | 10 | ||||
| -rw-r--r-- | perf/c/remote_lat.c | 11 | ||||
| -rw-r--r-- | perf/c/remote_thr.c | 11 | 
4 files changed, 27 insertions, 16 deletions
diff --git a/perf/c/local_lat.c b/perf/c/local_lat.c index 81a2e0c..92cfadf 100644 --- a/perf/c/local_lat.c +++ b/perf/c/local_lat.c @@ -35,13 +35,13 @@ int main (int argc, char *argv [])      struct zmq_msg_t msg;      if (argc != 4) { -        printf ("usage: local_lat <bind-to> <roundtrip-count> " -            "<message-size>\n"); +        printf ("usage: local_lat <bind-to> <message-size> " +            "<roundtrip-count>\n");          return 1;      }      bind_to = argv [1]; -    roundtrip_count = atoi (argv [2]); -    message_size = atoi (argv [3]); +    message_size = atoi (argv [2]); +    roundtrip_count = atoi (argv [3]);      ctx = zmq_init (1, 1);      assert (ctx); @@ -68,6 +68,9 @@ int main (int argc, char *argv [])      sleep (1); +    rc = zmq_close (s); +    assert (rc == 0); +      rc = zmq_term (ctx);      assert (rc == 0); diff --git a/perf/c/local_thr.c b/perf/c/local_thr.c index 64c492d..71ed21c 100644 --- a/perf/c/local_thr.c +++ b/perf/c/local_thr.c @@ -41,13 +41,12 @@ int main (int argc, char *argv [])      double megabits;      if (argc != 4) { -        printf ("usage: local_thr <bind-to> <message-count> " -            "<message-size>\n"); +        printf ("usage: local_thr <bind-to> <message-size> <message-count>\n");          return 1;      }      bind_to = argv [1]; -    message_count = atoi (argv [2]); -    message_size = atoi (argv [3]); +    message_size = atoi (argv [2]); +    message_count = atoi (argv [3]);      ctx = zmq_init (1, 1);      assert (ctx); @@ -92,6 +91,9 @@ int main (int argc, char *argv [])      printf ("mean throughput: %d [msg/s]\n", (int) throughput);      printf ("mean throughput: %.3f [Mb/s]\n", (double) megabits); +    rc = zmq_close (s); +    assert (rc == 0); +      rc = zmq_term (ctx);      assert (rc == 0); diff --git a/perf/c/remote_lat.c b/perf/c/remote_lat.c index 32329b8..6da1c42 100644 --- a/perf/c/remote_lat.c +++ b/perf/c/remote_lat.c @@ -39,13 +39,13 @@ int main (int argc, char *argv [])      double latency;      if (argc != 4) { -        printf ("usage: remote_lat <connect-to> <roundtrip-count> " -            "<message-size>\n"); +        printf ("usage: remote_lat <connect-to> <message-size> " +            "<roundtrip-count>\n");          return 1;      }      connect_to = argv [1]; -    roundtrip_count = atoi (argv [2]); -    message_size = atoi (argv [3]); +    message_size = atoi (argv [2]); +    roundtrip_count = atoi (argv [3]);      ctx = zmq_init (1, 1);      assert (ctx); @@ -87,6 +87,9 @@ int main (int argc, char *argv [])      printf ("roundtrip count: %d\n", (int) roundtrip_count);      printf ("average latency: %.3f [us]\n", (double) latency); +    rc = zmq_close (s); +    assert (rc == 0); +      rc = zmq_term (ctx);      assert (rc == 0); diff --git a/perf/c/remote_thr.c b/perf/c/remote_thr.c index 1010bc9..9606d00 100644 --- a/perf/c/remote_thr.c +++ b/perf/c/remote_thr.c @@ -35,13 +35,13 @@ int main (int argc, char *argv [])      struct zmq_msg_t msg;      if (argc != 4) { -        printf ("usage: remote_thr <connect-to> <message-count> " -            "<message-size>\n"); +        printf ("usage: remote_thr <connect-to> <message-size> " +            "<message-count>\n");          return 1;      }      connect_to = argv [1]; -    message_count = atoi (argv [2]); -    message_size = atoi (argv [3]); +    message_size = atoi (argv [2]); +    message_count = atoi (argv [3]);      ctx = zmq_init (1, 1);      assert (ctx); @@ -63,6 +63,9 @@ int main (int argc, char *argv [])      sleep (10); +    rc = zmq_close (s); +    assert (rc == 0); +      rc = zmq_term (ctx);      assert (rc == 0);  | 
