Reputation: 155
I would like to know what is the expected error code returned if the IoTHub device is disabled while still connected in the IoTHub. I tested it with the scenario below:
Scenario A:
Actual result: Error code received was IOTHUB_CLIENT_CONNECTION_NO_NETWORK
I expect that the error code should be IOTHUB_CLIENT_CONNECTION_DEVICE_DISABLED
Scenario B:
Scenario B is expected. How about scenario A?
Thank you very much for your support!
Upvotes: 0
Views: 645
Reputation: 347
This seems related to the limited error reporting in MQTT 3.1.1. The server will drop the connection when the device is disabled in IoTHub, it has no implicit mechanism to tell the client why it was disconnected. The client experiences network issue which then gets surfaced.
In the second case once the TCP connection is initiated the server expects CONNECT frame but as the device is disabled the server returns 0x03 which is translated as disabled. The possible errors are again limited as you can see in the specs. http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html section 3.2.2.3
Upvotes: 1