在 Azure Iot Hub 中保持活动延迟

Keep alive delays in Azure Iot Hub

我有设备通过 AMQP 协议连接到 iot-hub。我正在寻找如何更改设备和集线器之间 "keep alive delays" 的超时。可能吗? 我已经尝试从这个 C SDK 站点设置超时:https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/Iothub_sdk_options.md,但到目前为止没有积极的结果。

我已经找到解决办法了。这是:

// https://github.com/Azure/azure-iot-sdk-/blob/master/doc/Iothub_sdk_options.md
// note that not all option suits selected protocol     
const int KEEP_ALIVE_TIMEOUT_S = 30;
auto result = IoTHubDeviceClient_SetOption(deviceHandle, OPTION_C2D_KEEP_ALIVE_FREQ_SECS, &KEEP_ALIVE_TIMEOUT_S);