admin管理员组文章数量:1123272
I'm trying to set up an Azure IotHub client with the C SDK, and I noticed that if I don't send out a new MQTT message every 10 seconds, the connection to the Hub is closed. I'd like to increase this timeout, and I think the option I need is "keepalive"
(OPTION_KEEP_ALIVE
, see this doc page). However, if I try to do
IOTHUB_DEVICE_CLIENT_LL_HANDLE device_ll_handle;
// [...]
int keepalive = 20;
IoTHubTransport_MQTT_Common_SetOption(device_ll_handle, OPTION_KEEP_ALIVE, &keepalive);
// [...]
device_ll_handle = IoTHubDeviceClient_LL_CreateFromConnectionString(connection_string, iothub_transport)
in the code opening the device handle, I end up with a SEGFAULT, because it detects the connection as already open, and it tries to disconnect with DisconnectFromClient(transport_data)
. I can't find in the doc how to set this option: where should I set it? Thanks!
本文标签: How can I set the MQTT keepalive in the Azure IoTHub C SDKStack Overflow
版权声明:本文标题:How can I set the MQTT keepalive in the Azure IoTHub C SDK? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736559092a1944620.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论