offline_publish(3)
okay so bestie, this is the offline_publish(3) page from the Library Functions Manual, and it's literally about Publish While Disconnected 😭💖
✨ NAME ✨
offline_publish— Publish While Disconnected 🦋
okay so the tea ☕: this feature was not originally available because with persistence enabled, messages could be stored locally without ever knowing if they could be sent. like, the client application could have created the client with an erroneous broker address or port, for instance. so you'd have messages just sitting there like 👁️👄👁️ not knowing their fate.
to enable messages to be published when the application is disconnected, MQTTAsync_createWithOptions must be used instead of MQTTAsync_create to create the client object. the MQTTAsync_createOptions field sendWhileDisconnected must be set to non-zero, and the maxBufferedMessages field set as required — the default being 100. no cap, that's the whole recipe 🎀
MQTTAsync_getPendingTokens can be called to return the ids of the messages waiting to be sent, or for which the sending process has not completed. so if you're like "bestie where are my pending tokens at?" that's your girl 💅✨
and that's the page, bestie! this offline_publish(3) is brought to you by Paho Asynchronous MQTT C... and dated Tue Jun 2 2026 00:00:00 🫶💜
📦 where this page comes from
- fedora 44: paho-c-devel 1.3.16-1.fc44 · BSD-3-Clause AND EPL-2.0
- fedora 44: paho-c-devel 1.3.16-1.fc44 · BSD-3-Clause AND EPL-2.0
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms