version 1.2.2.6, 2012/05/08 11:45:57
|
version 1.2.2.7, 2012/05/08 13:04:02
|
Line 83 Unsubscribe(int sock)
|
Line 83 Unsubscribe(int sock)
|
srandomdev(); |
srandomdev(); |
mid = random() % USHRT_MAX; |
mid = random() % USHRT_MAX; |
|
|
|
printf(" > Execute UNSUBSCRIBE request #%d ... ", mid); |
if (mqtt_cli_Unsubscribe(args->cli, args->subscr, mid, args->Dup, MQTT_QOS_ACK)) { |
if (mqtt_cli_Unsubscribe(args->cli, args->subscr, mid, args->Dup, MQTT_QOS_ACK)) { |
printf("Error:: Unsubscribe #%d - %s\n", mqtt_GetErrno(), mqtt_GetError()); |
printf("Error:: Unsubscribe #%d - %s\n", mqtt_GetErrno(), mqtt_GetError()); |
return -1; |
return -1; |
} | } else |
| printf("OK\n"); |
|
|
return 0; |
return 0; |
} |
} |
Line 270 main(int argc, char **argv)
|
Line 272 main(int argc, char **argv)
|
else |
else |
lf = stdout; |
lf = stdout; |
if (lf) { |
if (lf) { |
ret = un ? Unsubscribe(args->cli->sock) : Subscribe(args->cli->sock, lf); | ret = Subscribe(args->cli->sock, lf); |
| if (un) |
| Unsubscribe(args->cli->sock); |
fclose(lf); |
fclose(lf); |
} else |
} else |
printf("Error:: in subscribe file #%d - %s\n", errno, strerror(errno)); |
printf("Error:: in subscribe file #%d - %s\n", errno, strerror(errno)); |