]> git.meshlink.io Git - meshlink/blobdiff - examples/manynodes.c
Restart the mesh after a failed join() in the other examples as well.
[meshlink] / examples / manynodes.c
index f0fc22da8443621dc448a96dc1410a0b2b240bd4..0aafbcef25c661aa03a0825783ffdb119ffe5ce8 100644 (file)
@@ -221,7 +221,10 @@ static void parse_command(char *buf) {
                        fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno));
                else {
                        fprintf(stderr, "Invitation accepted!\n");
-                       meshlink_start(mesh[nodeindex]);
+               }
+               if(!meshlink_start(mesh[nodeindex])) {
+                       fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno));
+                       exit(1);
                }
        } else if(!strcasecmp(buf, "kick")) {
                if(!arg) {