Hello @Slava A ,
!Please understand that as mentioned in the related thread, the scenario of "opening a second connection to a device" is unsupported and exceptions\errors you receive are expected.
1) is it possible for SDK to internally manage connections and automatically disable "old" connection when new connection is created
If you can recognize the new connection created with the exception or error thrown by the SDK then you can "manipulate" SDK behavior based on that. See 400027 ConnectionForcefullyClosedOnNewConnection
PS: I am validating internally if this also applied when you connect with AMQP transport type.
2) if one of the connections is closed, the other seems to reconnect and starts to work. is there a timeout associated with this reconnect? or it will try to reconnect until it succeeds?
It will retry based on the retry policy: https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-client/devdoc/requirement_docs/com/microsoft/azure/iothub/retryPolicy.md
Thanks!
Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
- Want a reminder to come back and check responses? Here is how to subscribe to a notification.