After updating the KMQTT Client library ( <https:/...
# kotlin-native
n
After updating the KMQTT Client library ( https://gitlab.com/napperley/kmqtt-client ) to use Kotlin 1.4.0 the callback handling breaks. What changes were made to CFunction in Kotlin 1.4.0?
l
You need to tell how it is breaking at the very least for us to help.
n
The callbacks aren't being called by the C library ( https://github.com/eclipse/paho.mqtt.c ) that the Kotlin library relies on. All callbacks are set via the MQTTClient_setCallbacks function ( https://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/_m_q_t_t_client_8h.html#aad27d07782991a4937ebf2f39a021f83 ) that the Kotlin library uses in behind the scenes. Having done some testing with the MQTTClient_setCallbacks function I do know that the function is always returning MQTTCLIENT_SUCCESS in the Kotlin library.
Kotlin Native's memory model is shifting around which could be causing problems. The MQTTClient_setCallbacks function does use multiple threads which could be causing issues.
Found out that I was using the wrong MQTT QoS for the messages when publishing 🤦‍♂️ (in the project which is using the library). With that sorted the callbacks are now working 😄.