damienpontifex / azure-iot-sdk-rs

A rust library for connecting devices to Microsoft Azure IoT Hub
MIT License
14 stars 11 forks source link

Increase the time between pings #74

Open CryZe opened 2 years ago

CryZe commented 2 years ago

Doing a ping every 8 seconds is just way too often, especially if it gets logged every time. This makes it so it's closer to the official IoT Hub SDKs.

CryZe commented 1 year ago

It seemed to be somewhere in the middle, sounded reasonable to me (also being a multiple of 60s), and with Rust being on the same level as C, that seemed appropriate.

damienpontifex commented 1 year ago

I believe it was shortened due to this issue #50

Need to improve the reconnect logic (or add reconnection really) to resolve that rule. My concern here would be decreasing the ping time causes disconnection issues which, at the moment, are worse than an overly eager ping.

Thoughts/feedback/experiences?

CryZe commented 1 year ago

We've definitely encountered the reconnection problem as well. We simply re-establish the connection when the error spam starts happening (with a simple "5 errors and no successful message in between" as a heuristic). I think #50 was mostly resolved by #53 and only the reconnection is the remaining problem. We've been running the branch here for a long time now and the increased ping times don't seem to cause any problems.