version 1.2.2.14, 2012/06/20 12:43:41
|
version 1.2.2.17, 2012/06/26 08:05:58
|
Line 73 Subscribe(int sock, FILE *lf)
|
Line 73 Subscribe(int sock, FILE *lf)
|
printf("OK\n"); |
printf("OK\n"); |
|
|
for (sub = args->subscr, qos = qoses; sub->sub_topic.msg_base; sub++, qos++) |
for (sub = args->subscr, qos = qoses; sub->sub_topic.msg_base; sub++, qos++) |
printf(" + Topic %s with QoS %d subscribed %s\n", (char*) | printf(" + Topic %s with QoS %d subscribe %s\n", (char*) |
sub->sub_topic.msg_base, sub->sub_ret, *qos ? "done" : "failed"); |
sub->sub_topic.msg_base, sub->sub_ret, *qos ? "done" : "failed"); |
|
|
free(qoses); |
free(qoses); |
Line 163 pubRX(sched_task_t *task)
|
Line 163 pubRX(sched_task_t *task)
|
/* send to output */ |
/* send to output */ |
tim = time(NULL); |
tim = time(NULL); |
strftime(szTime, sizeof szTime, "%Y-%m-%d %H:%M:%S", localtime(&tim)); |
strftime(szTime, sizeof szTime, "%Y-%m-%d %H:%M:%S", localtime(&tim)); |
fprintf(TASK_ARG(task), "\n[%s] Message ID: 0x%04hu, Length: %u, Topic: %s\n", | fprintf(TASK_ARG(task), "\n[%s] Message ID: %04hu, Length: %u, Topic: %s\n", |
szTime, mid, siz, szTopic); |
szTime, mid, siz, szTopic); |
|
|
if (data) { |
if (data) { |
Line 390 main(int argc, char **argv)
|
Line 390 main(int argc, char **argv)
|
else |
else |
lf = stdout; |
lf = stdout; |
if (lf) { |
if (lf) { |
root = schedBegin(); |
|
|
|
ret = Subscribe(args->cli->sock, lf); |
ret = Subscribe(args->cli->sock, lf); |
|
|
|
root = schedBegin(); |
|
|
schedRead(root, pubRX, lf, args->cli->sock, NULL, 0); |
schedRead(root, pubRX, lf, args->cli->sock, NULL, 0); |
schedRun(root, &Kill); |
schedRun(root, &Kill); |
|
|
|
schedEnd(&root); |
|
|
if (un) |
if (un) |
Unsubscribe(args->cli->sock); |
Unsubscribe(args->cli->sock); |
fclose(lf); |
fclose(lf); |
|
|
schedEnd(&root); |
|
} else |
} else |
printf("Error:: in output file #%d - %s\n", errno, strerror(errno)); |
printf("Error:: in output file #%d - %s\n", errno, strerror(errno)); |
} else |
} else |