Heartbeating

If the connection between the device and the fault adapter fails, heartbeating allows the probe to determine whether the device is still operational.

The heartbeating feature has three properties:

  • HeartbeatInterval
  • HeartbeatTimeout
  • HeartbeatRetryCount

If the probe does not receive any data for the time specified by the HeartbeatInterval property, it pings the device. If the device does not respond to the ping within the time specified by the HeartbeatTimeout property, the probe pings the device again. The time between each heartbeat ping is specified by the HeartbeatInterval property. The HeartbeatRetryCount property controls how many times the probe pings the device. If the probe sends a number of consecutive pings equal to the value specified by the HeartbeatRetryCount property, and the probe receives no response, it closes the connection to the device and tries to reconnect.

By default, heartbeating is disabled. To enable it, set the HeartbeatTimeout property to a positive integer.

Note:

For this feature to work correctly, the following conditions must be met:

  1. The value of the HeartbeatInterval property must be an exact multiple of the value of the ReadTimeout property.
    For example, to use a HeartbeatInterval of 10 seconds, set the ReadTimeout property to one of the following values:
    • 10000 (10 seconds)
    • 5000 (5 seconds)
    • 2000 (2 seconds)
    • 1000 (1 second)
  2. The value of the HeartbeatTimeout property must be greater than the value of the ReadTimeout property and less than the value of the HeartbeatInterval property.

Example usage

Suppose the heartbeating properties are set in the properties file using the following values:

ReadTimeout         : 5 
HeartbeatInterval   : 10
HeartbeatTimeout    :	6 
HeartbeatRetryCount : 3

If the probe does not receive any events from the device within 5 seconds (as specified by the ReadTimeout property), it will wait a further 5 seconds (making a total of the 10 seconds specified by the HeartbeatInterval) before it sends a ping command to the device.

If the device does not respond to the ping command within 6 seconds (as specified by the HeartbeatTimeout period), the probe will wait another 10 seconds (as specified by the HeartbeatInterval property) before it sends a second ping command to the device.

If the device does not respond to the probe after 3 attempts, (as specified by the HeartbeatRetryCount property) the probe will close the connection to the device and try to reconnect. For details about the standard backoff strategy and specifying reconnection details, see Reconnection settings.