ConnectionStatusChangeReason Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The reason for a connection status change from a connection change event.
public enum ConnectionStatusChangeReason
type ConnectionStatusChangeReason =
Public Enum ConnectionStatusChangeReason
- Inheritance
-
ConnectionStatusChangeReason
Fields
Name | Value | Description |
---|---|---|
ClientClosed | 0 | The client has not been opened or has been closed gracefully. |
Connection_Ok | 0 | The client is connected, and ready to be used. This is returned with a connection status of Connected. |
ConnectionOk | 1 | The client is connected and ready to perform device operations. |
Expired_SAS_Token | 1 | The SAS token associated with the client has expired, and cannot be renewed. The supplied credentials need to be fixed before a connection can be established. NOTE: This is currently not used in the client library. |
CommunicationError | 2 | When a device encounters a connection error, subsequent operations on the client will fail until conneciton has been re-established. |
Device_Disabled | 2 | The device/ module has been deleted or marked as disabled (on your IoT hub instance). Fix the device/ module status in Azure before attempting to create the associated client instance. This is returned with a connection status of Disconnected. |
Bad_Credential | 3 | Incorrect credentials were supplied to the client instance. The supplied credentials need to be fixed before a connection can be established. This is returned with a connection status of Disconnected. |
RetryExpired | 3 | The client was disconnected due to a transient exception and the retry policy expired. |
BadCredential | 4 | Incorrect credentials were supplied to the client instance. |
Retry_Expired | 4 | The client was disconnected due to a transient exception, but the retry policy expired before a connection could be re-established. If you want to perform more operations on the device client, one should call Dispose() and then re-initialize the client. This is returned with a connection status of Disconnected. |
DeviceDisabled | 5 | The device/module has been deleted or marked as disabled in the IoT hub instance. |
No_Network | 5 | The client was disconnected due to loss of network. NOTE: This is currently not used in the client library. |
Communication_Error | 6 | This can be returned with either a connection status of Disconnected_Retrying or Disconnected. When returned with a connection status of Disconnected_Retrying, this signifies that the client is trying to recover from a disconnect due to a transient exception. Do NOT close or open the client instance. Once the client successfully reports Connected, you can resume operations on the client. When returned with a connection status of Disconnected signifies that client is disconnected due to a non-retryable exception. If you want to perform more operations on the device client, one should call Dispose() and then re-initialize the client. |
Client_Close | 7 | The client has been closed gracefully. If you want to perform more operations on the device client, one should call Dispose() and then re-initialize the client. This is returned with a connection status of Disabled |
Applies to
Azure SDK for .NET