From 20bac67a09728d66dbf27cecf57fa3a3a9e170a2 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Sat, 9 Aug 2014 12:06:53 +0200 Subject: [PATCH] example manynodes: send test messages only to other nodes and not to ourselfs --- examples/manynodes.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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)); - } - } + } + } + } } -- 2.39.5