I have an MQTT instance running, I would like to close it when the app is exited, currently I have this the code below, but i get the errors. How can I pass the MqttClient to the function, and close the connection?
protected override void OnSleep(var client) { client.DisconnectAsync(); }