Report the current state of the connection
Agent
Integer — A connection state code
This method provides your code with a means to determine the state of the connection linking the target mqttclient object and the MQTT broker.
The value returned by the method will be one of the following:
| Connection State Code | State |
|---|---|
| 0 | Disconnected |
| 1 | Connecting |
| 2 | Connected |
| 3 | Disconnecting |