Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Message Arrived in Paho C Async Lib Callback

Hello Ian, and all,

In the latest Paho C Async library, the publish example, MQTTAsync_publish.c, sets the callbacks as so (~line 126):
MQTTAsync_setCallbacks(client, NULL, connlost, NULL, NULL);
As makes sense with a publish-only client, it sets the 4th parameter for a "message arrived" callback to NULL.

The implementation of the MQTTAsync_setCallbacks function, however, rejects the NULL value for message arrived (ma) parameter, in MQTTAsync.c (~line 1719):
if (m == NULL || ma == NULL || m->c->connect_state != 0)
    rc = MQTTASYNC_FAILURE;
else
   ...
Which of these should be the correct behavior?  I'm guessing that the library should accept a NULL value for the callback (?).

Thanks,
Frank

Back to the top