]> git.meshlink.io Git - meshlink/blobdiff - test/import-export.c
Test whether UDP communication is working.
[meshlink] / test / import-export.c
index 17beaaf0ea8e6a665088cb4de36baf8956d22ecd..d6498c24b6647828a1fffb45f676623ee67eb2fc 100644 (file)
@@ -86,6 +86,17 @@ int main(int argc, char *argv[]) {
                return 1;
        }
 
+       int pmtu = meshlink_get_pmtu(mesh2, meshlink_get_node(mesh2, "bar"));
+       for(int i = 0; i < 10 && !pmtu; i++) {
+               sleep(1);
+               pmtu = meshlink_get_pmtu(mesh2, meshlink_get_node(mesh2, "bar"));
+       }
+
+       if(!pmtu) {
+               fprintf(stderr, "UDP communication with bar not possible after 10 seconds\n");
+               return 1;
+       }
+
        // Clean up.
 
        meshlink_stop(mesh2);