summaryrefslogtreecommitdiffstats
path: root/test/rctest.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-07-05 18:53:18 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-07-05 18:53:18 +0000
commit0effff5f4fe0fac9a986bb01dc547a99772d1bfa (patch)
tree93eb015dc702800e6225791fc2c6e9e2a4f4b26c /test/rctest.c
parent431ac89881eaed4c44f2204736ba5debe2d29a33 (diff)
Allow connects to multiple remote devices
Diffstat (limited to 'test/rctest.c')
-rw-r--r--test/rctest.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/rctest.c b/test/rctest.c
index 17d7c5d3..8de23f78 100644
--- a/test/rctest.c
+++ b/test/rctest.c
@@ -390,22 +390,24 @@ static void reconnect_mode(char *svr)
}
}
-static void multi_connect_mode(char *svr)
+static void multi_connect_mode(int argc, char *argv[])
{
- while (1) {
- int i, sk;
-
- for (i = 0; i < 10; i++) {
- if (fork()) continue;
+ int i, n, sk;
- /* Child */
- sk = do_connect(svr);
- usleep(500);
- close(sk);
- exit(0);
+ while (1) {
+ for (n = 0; n < argc; n++) {
+ for (i = 0; i < count; i++) {
+ if (fork())
+ continue;
+
+ /* Child */
+ sk = do_connect(argv[n]);
+ usleep(500);
+ close(sk);
+ exit(0);
+ }
}
-
- sleep(2);
+ sleep(4);
}
}
@@ -589,7 +591,7 @@ int main(int argc, char *argv[])
break;
case MULTY:
- multi_connect_mode(argv[optind]);
+ multi_connect_mode(argc - optind, argv + optind);
break;
case CONNECT: