Heartbeat Timer

When an application program links to the API library, it can optionally request that the API library set up a heartbeat timer for the application. See 7.2.2. The API library uses the heartbeat timer to monitor the application program by determining whether or not the application program sends a message within the time interval set by the application program.

Each time the API library sends a message to the Operations Sentinel server, the heartbeat timer is reset. If there are no messages to be sent, the application program can reset its timer by calling the SEND_STATUS procedure.

When the API library detects that an application program's heartbeat timer has expired, it determines which one of these conditions caused the timer to elapse:

When the timer has expired, the API library determines whether the application program is still active in the current program mix. If the application program is still active, the API library sends the following message to Operations Sentinel indicating that the timer has expired. In this message, appl-id is the application identifier returned by the LINK_APPL_PROGRAM procedure.

appl-id application–program–name		HEARTBEAT TIMER EXPIRED

When the timer has expired and the application program is no longer active, the API library sends the following message to Operations Sentinel indicating that the application program has terminated without notifying the API library:

appl-id application–program–name		APPLICATION TERMINATED WITHOUT UNLINKING

When the second condition is true, the API library also removes the application from its active application table.

The API library sends the following message to Operations Sentinel when the application program calls the SEND_STATUS or SEND_MESSAGE procedure, and the most recent message the API library sent to the Operations Sentinel server was HEARTBEAT TIMER EXPIRED:

appl-id application–program–name		HEARTBEAT RESUMED

The API library does not send this message if the application has terminated and restarted with a different mixnum. Similarly, it does not send this message if the application’s heartbeat timer has not expired since the most recent call to SEND_STATUS or SEND_MESSAGE.