if(!meshlink_join(mesh, arg))
fprintf(stderr, "Could not join using invitation: %s\n", mesh->errstr);
- else
+ else {
fprintf(stderr, "Invitation accepted!\n");
+ meshlink_start(mesh);
+ }
} else if(!strcasecmp(buf, "kick")) {
if(!arg) {
fprintf(stderr, "/kick requires an argument!\n");
if(!meshlink_start(mesh)) {
fprintf(stderr, "Could not start MeshLink: %s\n", mesh->errstr);
- return 1;
}
printf("Chat started.\nType /help for a list of commands.\n");
WSAStartup(MAKEWORD(2, 2), &wsa_state);
#endif
- // Setup up everything
- // TODO: we should not open listening sockets yet
-
- if(!setup_network(mesh))
- return meshlink_close(mesh), NULL;
return mesh;
}
fprintf(stderr, "No name given!\n");
return false;
}
+ // Setup up everything
+
+ if(!setup_network(mesh))
+ return meshlink_close(mesh), NULL;
// Start the main thread