| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Send a heartbeat to the HAM
#include <ha/ham.h> int ham_heartbeat( void );
libham
Self-attached entities that have committed to sending heartbeats at prescribed intervals need to call ham_heartbeat() when they want to transmit a heartbeat.
The ham_heartbeat() function does nothing if the client isn't a self-attached entity or hasn't committed to sending heartbeats.
This function always succeeds.
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | Yes | 
Although this function always succeeds, the HAM doesn't always receive the heartbeat right away.
For example, if a client commits to sending a heartbeat every 5 seconds (at 5-, 10-, 15-second intervals, and so on), but instead transmits at the 2-second mark, then the HAM won't receive a heartbeat until the 5-second mark.
Or if the client sends a heartbeat at the 7-second mark and another at the 8-second mark, then the HAM will receive only one heartbeat at the 10-second mark.
ham_attach_self(), ham_detach_self()
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |