Closed nitej closed 7 years ago
hi @foodbag , okay, I will update initialize method to public. then disconnect/connect like this.
mqtt.publish("topic/", "hoge");
mqtt.disconnect();
mqtt.initialize("example.com", NULL, 1883, callback, MQTT_MAX_PACKET_SIZE);
mqtt.publish("topic/", "hoge");
That would be great. Thanks!
Using the initialize method to update the broker address may cause a memory leak if called multiple times before resetting. It might be safer to update just the domain/ip and port rather than reinitializing.
Would it be possible to support changing the server address after constructing the mqtt object? This would be useful if one wants to change the mqtt broker address without reflashing.