An application should call licence_heartbeat/4 occasionally (e.g. every few minutes) in order to make sure that the licence server is still running. When everything is ok, zero is returned in the last argument, otherwise the number of failed connection attempts.
The second and third argument allow to check whether the licence server has been shut down and restarted. If that happens, the heartbeat call will reconnect to the server. If many such reconnects happen in a short amount of time, this is suspicious and may indicate an attempt to illegally obtain more licences.
If a feature had been checked out multiply, a heartbeat is performed for every checked out licence, and the reconnection counts are added up.
..., ( sepia_kernel:licence_heartbeat(swapper, 10, R, 0) -> ( R > 3 -> writeln(error, "Licence server suspicious"), abort ; true ) ; writeln(error, "Licence server not responding"), abort ), ...