Timeout settings

The function blocks of TC3 IoT Functions include several timeout settings that may help the user to handle errors regarding the retry operations. The following section explains the different timeout settings more detailed.

RequestTimeout

The RequestTimeout can be either set globally on an instance of FB_IotFunctions_Connector or individually on an instance of FB_IotFunctions_Message. Individual settings always override global settings. The RequestTimeout closely works together with the MessageRetryInterval setting.

The RequestTimeout specifies when a message operation (read/write) will time out. For example, if RequestTimeout is set to 10000, a read operation will time out after 10 seconds if no data has been received. If data is received within 10 seconds, the operation will finish immediately.

MessageRetryInterval

The MessageRetryInterval can be either set globally on an instance of FB_IotFunctions_Connector or individually on an instance of FB_IotFunctions_Message. Individual settings always override global settings. The MessageRetryInterval closely works together with the RequestTimeout setting.

The MessageRetryInterval specifies the time interval in [ms] when a message operation will be retried. The upper limit of the interval is always the RequestTimeout. For example, if RequestTimeout is set to 10000 and MessageRetryInterval to 1000, a read operation will be retried ten times before the RequestTimeout is triggered and the read operation times out.

CumulativeTimeout

The CumulativeTimeout can be set on instances of FB_IotFunctions_Request when synchronizing message operations (see Synchronizing message operations).

The use case is as follows (example):

  • There are three read operations that should be synchronized.
  • Every read operation comes from a different channel
  • RequestTimeout is globally set to 10000 ms
  • CumulativeTimeout is globally set to 3000 ms
  • After 8000 ms the first message comes in via channel 1.
  • Since only 2000 ms remain until the RequestTimeout time is reached, the CumulativeTimeout is added to the remaining RequestTimeout time, to prevent a time out of the whole request. The RequestTimeout time is then 5000 ms. This gives the request more time to gather data via the other two read operations. If there is no data on the other two operations after 5000 ms, the whole request will time out.