MultiplexingClient.registerConnectionStatusChangeCallback(IotHubConnectionStatusChangeCallback callback, Object callbackContext) 方法


Registers a callback to be executed when the connection status of the multiplexed connection as a whole changes. The callback will be fired with a status and a reason why the multiplexed connection's status changed. When the callback is fired, the provided context will be provided alongside the status and reason.

Note that this callback will not be fired for device specific connection status changes. In order to be notified when a particular device's connection status changes, you will need to register a connection status change callback on that device client instance using registerConnectionStatusChangeCallback(IotHubConnectionStatusChangeCallback callback, Object callbackContext).

Note that the thread used to deliver this callback should not be used to call open()/closeNow() on the client that this callback belongs to. All open()/closeNow() operations should be done on a separate thread

public void registerConnectionStatusChangeCallback(IotHubConnectionStatusChangeCallback callback, Object callbackContext)



The callback to be fired when the connection status of the multiplexed connection changes. Can be null to unset this listener as long as the provided callbackContext is also null.


a context to be passed to the callback. Can benull 

</code> . </p>