Allows to enable alive supervision on the provided connection. The function enables a permanent test every check_period to ensure the connection is working. The check is implemented by a simply request/reply with an unreplied tracking to ensure we detect connection lost even when power failures or network cable unplug. The function accepts a max_unreply_count which usually is 0 (no unreplied messages accepted) or the amount of unreplied messages we are accepting until calling to failure handler or shutdown the connection. The failure_handler is optional. If not provided, the alive check will call to shutdown the connection (vortex_connection_shutdown), activating connection on close configured (vortex_connection_set_on_close_full) so close handling is unified on the same place. However, if failure_handler is defined, the alive check will not shutdown the connection and will call the handler.
|