]> git.meshlink.io Git - meshlink/commitdiff
example manynodes fixed to use meshlink_join
authorSaverio Proto <zioproto@gmail.com>
Fri, 8 Aug 2014 13:17:37 +0000 (13:17 +0000)
committerSaverio Proto <zioproto@gmail.com>
Fri, 8 Aug 2014 13:18:52 +0000 (15:18 +0200)
examples/manynodes.c

index 64a2657bfe8c54560b3e1991ab16b25bbeea7a19..991d5ba65868622a36b68900f15c0bb20f1d74fb 100644 (file)
@@ -56,11 +56,13 @@ static void parse_command(char *buf) {
                        fprintf(stderr, "/join requires an argument!\n");
                        return;
                }
-
+               meshlink_stop(mesh[0]);
                if(!meshlink_join(mesh[0], arg))
                        fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno));
-               else
+               else {
                        fprintf(stderr, "Invitation accepted!\n");
+                       meshlink_start(mesh[0]);
+               }
        } else if(!strcasecmp(buf, "kick")) {
                if(!arg) {
                        fprintf(stderr, "/kick requires an argument!\n");