johanmeijer/grott

Please don't send each MQTT message in its own TCP connection

nwf opened this issue · 0 comments

nwf commented

Rather than using paho.mqtt.publish's single method, please build a long-lived client object and use it to publish messages in turn. Establishing a new connection each time taxes the broker unnecessarily and especially so in combination with TLS (as in #377). If this would be welcome, I can try to carve out some time to raise the PR myself.