Determine whether an MQTT client is connected to a broker
true if the client is connected, otherwise
This method allows your code to quickly determine whether an mqttclient object is currently connected to an MQTT broker: it will return
true if this is the case, otherwise
Note If your code receives
true from mqttclient.isconnected(), we recommend you still wrap any communication calls, eg. sending a message, within a
try... catch structure. This is because the connection could fail while the agent is attempting to send the message.