1callbacks(3)               Library Functions Manual               callbacks(3)
2
3
4

NAME

6       callbacks - Callbacks You must not call a function from this API from
7       within a callback otherwise a deadlock might result. The only exception
8       to this is the ability to call connect within the connection lost
9       callback, to allow a reconnect.
10
11       When using MQTT 5.0, you can also call connect from within the
12       disconnected callback, which is invoked when the MQTT server sends a
13       disconnect packet. This server behaviour is allowed in MQTT 5.0, but
14       not in MQTT 3.1.1, so the disconnected callback will never be invoked
15       if you use MQTT 3.1.1.
16
17       In particular, you must make a publish call within the message arrived
18       callback. These restrictions are all lifted in the MQTTAsync API.
19
20       If no callbacks are assigned, this will include the message arrived
21       callback. This could be done if the application is a pure publisher,
22       and does not subscribe to any topics. If however messages are received,
23       and no message arrived callback is set, or receive not called, then
24       those messages will accumulate and take up memory, as there is no place
25       for them to be delivered. It is up to the application to protect
26       against this situation.
27
28
29
30Paho MQTT C Client Library      Sat May 29 2021                   callbacks(3)
Impressum