As soon as the MQTT client receives data on any of the topics it has subscribed to, it raises the OnContentReceived event. We provide an event handler to parse incoming data.
Extra care must be taken, considering we don't know who sent the data, how the data has been encoded, or even if it is correctly encoded.
Also remember that the maximum size of an MQTT packet is 256 MB, which may create temporary memory problems for small devices.
In the new MQTT v5 specification published by Oasis on December 25 2017, a client can specify a maximum packet size. This would mitigate this problem if supported. There is also a possibility to control the flow of packets, by stating the amount of concurrent packages requiring ...