Search code examples
azureazure-iot-hubazure-iot-hub-device-management

Keep alive delays in Azure Iot Hub


I have device connected to the iot-hub via the AMQP protocol. I'm looking how to change the timeout of the "keep alive delays" between device and hub. Is it possible? I've already tried to set timeouts from this C SDK site: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/Iothub_sdk_options.md , but with no positive result so far.


Solution

  • I've already found the solution. Here it is:

    // 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);