X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fmanynodes.c;h=e00b80beeec203039fec0a353a65e827a62c2f5a;hb=9e43098a37fe37979d0bd19d4bf9d20eec2b6f1c;hp=98bd93872b57ed00d6ac9dcc2e35cef4ddb4ed06;hpb=fd44f0cfc413061df9fe7b623be113ab3ebcd6de;p=meshlink diff --git a/examples/manynodes.c b/examples/manynodes.c index 98bd9387..e00b80be 100644 --- a/examples/manynodes.c +++ b/examples/manynodes.c @@ -36,11 +36,13 @@ static void testmesh () { } else { printf("%zu known nodes:\n", nnodes); for(int i = 0; i < nnodes; i++) { - printf(" %s\n", nodes[i]->name); - if(!meshlink_send(mesh[nindex], nodes[i], "magic", strlen("magic") + 1)) { + //printf(" %s\n", nodes[i]->name); + if (nindex != i) { + if(!meshlink_send(mesh[nindex], nodes[i], "magic", strlen("magic") + 1)) { fprintf(stderr, "Could not send message to '%s': %s\n", nodes[i]->name, meshlink_strerror(meshlink_errno)); - } - } + } + } + } }