Closed bmrpatel closed 4 years ago
that does look like a bug. Thanks for pointing it out. We'll fix this in the sample code.
@bmrpatel, @YoDaMa, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey
In the following sample is calling removeAllListeners and then it is not added back wouldn't this break all the call backs for connect() called on the following line.
https://github.com/Azure/azure-iot-sdk-node/blob/85981e9985fb8499197c2eb0914f3588517b1f8d/device/samples/simple_sample_device.js#L22
When I am testing this sample code, I am also seeing that once disconnect is called device not accepting any DM calls or C2D messages? It becomes unresponsive and I have to restart the process. Sometimes it goes into the infinite loop of disconnect and connect. How do I avoid this issue? Do you have any sample which handles the disconnect with DM calls setup? How do I rewire all the DM calls so that after reconnect it is responsive.
Testing Disconnect I am causing disconnect by attaching the debugger, add break point in one of the DM and wait there for more than 4 minutes to cause timeout on connection. After this device gets into unresponsive mode event after it reconnects.
AB#7982563