--- mqtt/src/mqtt_subs.c 2012/06/20 15:01:30 1.2.2.16 +++ mqtt/src/mqtt_subs.c 2012/06/26 08:05:58 1.2.2.17 @@ -390,18 +390,18 @@ main(int argc, char **argv) else lf = stdout; if (lf) { - root = schedBegin(); - ret = Subscribe(args->cli->sock, lf); + root = schedBegin(); + schedRead(root, pubRX, lf, args->cli->sock, NULL, 0); schedRun(root, &Kill); + schedEnd(&root); + if (un) Unsubscribe(args->cli->sock); fclose(lf); - - schedEnd(&root); } else printf("Error:: in output file #%d - %s\n", errno, strerror(errno)); } else