X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fchat.c;h=37e067345f1561c1ac3fda2cbb53147f7c6b1d4c;hb=fc484c9dde648cad4c95af9763db674ab4be668f;hp=3eaa5c7e3b3fe5ef093b7955d0db011cf15591f0;hpb=2200060c4eaadae36b8150aa33b0db7c0d74722f;p=meshlink diff --git a/examples/chat.c b/examples/chat.c index 3eaa5c7e..37e06734 100644 --- a/examples/chat.c +++ b/examples/chat.c @@ -65,12 +65,11 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { meshlink_stop(mesh); if(!meshlink_join(mesh, arg)) fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno)); - else { + else fprintf(stderr, "Invitation accepted!\n"); - if(!meshlink_start(mesh)) { - fprintf(stderr, "Could not start MeshLink: %s\n", meshlink_strerror(meshlink_errno)); - return; - } + if(!meshlink_start(mesh)) { + fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno)); + exit(1); } } else if(!strcasecmp(buf, "kick")) { if(!arg) { @@ -195,7 +194,7 @@ int main(int argc, char *argv[]) { meshlink_set_log_cb(NULL, MESHLINK_INFO, log_message); - meshlink_handle_t *mesh = meshlink_open(confbase, nick, "chat", STATIONARY); + meshlink_handle_t *mesh = meshlink_open(confbase, nick, "chat", DEV_CLASS_STATIONARY); if(!mesh) { fprintf(stderr, "Could not open MeshLink: %s\n", meshlink_strerror(meshlink_errno)); return 1;