[MQTT-SN] No way to give back pressure #79539
Replies: 3 comments 6 replies
-
An other issue is, that the library ignores the result of the |
Beta Was this translation helpful? Give feedback.
-
@BeckmaR Sorry to bring you in this conversation, but as you were really helpful with the wait for suback issue, I thought it might be interesting to get your insights on this. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I get your point. From my experience though, almost all libraries in the embedded domain act like this. I have worked with Zephyr's Bluetooth stack before as well as the LwM2M stack in the Nordic Extensions - same problem, you can send data ad infinitum, until suddenly you get an error return code because the internal buffers are full. This is what it always boils down to - you can't send more data than your transport can handle, at least on average. You can handle temporary fluctuations by adding buffers, which is the way this library is designed, and at some point they will be full. All in all:
I'm not entirely sure that adding a function for a corner case that should not happen is a good idea, after all. |
Beta Was this translation helpful? Give feedback.
-
The current design of the MQTT-SN library just covers the case, that the library has to wait for input. The case, where the library has to wait for bandwidth on the outgoing link is (nearly) not covered.
If the library finds the output link being saturated, it will wait and retry. This leads then to either very poor performance (when that poll interval is large) or very much power consumption (if that poll interval is small).
My current workaround for that is a function (similar to
mqtt_sn_input()
) that can be called, when there is confidence, that a next attempt to transmit a message might not fail. Would such a workaround be accepted as a fix? Better ideas, as how to fix the issue with the current design?Beta Was this translation helpful? Give feedback.
All reactions