This work is directly derived from the famous PubSubClient library of Nick O'Leary, which can be found at https://pubsubclient.knolleary.net/ It is most or less a plain C rewrite.