Mosquitto-PHP icon indicating copy to clipboard operation
Mosquitto-PHP copied to clipboard

unsent messages at disconnect

Open blacktek opened this issue 7 years ago • 1 comments

after publish I do one loop() and then a disconnect(), but very often there are unsent messages that get lost.

Is there a clean way to verify if there are still messages in the queue and then iterate a loop() until the queue is empty? I could do this by using a counter to increment at each publish and to decrement at each onPublish, but is not a clean approach

blacktek avatar Aug 14 '18 14:08 blacktek

One loop isn't enough. I'd probably go for the counter option. I don't know offhand of any way to see if there's anything left in flight in the queue, I'll have another look though.

mgdm avatar Nov 21 '18 19:11 mgdm