int main(int argc, char *argv[]) {
// Open two new meshlink instance.
- meshlink_handle_t *mesh1 = meshlink_open("import_export_conf.1", "foo");
+ meshlink_handle_t *mesh1 = meshlink_open("import_export_conf.1", "foo", "import-export");
if(!mesh1) {
fprintf(stderr, "Could not initialize configuration for foo\n");
return 1;
}
- meshlink_handle_t *mesh2 = meshlink_open("import_export_conf.2", "bar");
+ meshlink_handle_t *mesh2 = meshlink_open("import_export_conf.2", "bar", "import-export");
if(!mesh2) {
fprintf(stderr, "Could not initialize configuration for bar\n");
return 1;
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);