ha_connection_ctrl()
Control the operation of a HA-aware connection
Synopsis:
#include <ha/cover.h>
int ha_connection_ctrl( int coid,
int command,
void *args );
Library:
libha
Description:
The ha_connection_ctrl() function can be used to control the operation of the HA-aware conenction. Specifically it can be used to control the recovery method, temporarily suspend recovery and also control the number of times that will be attempted both consecutively for a single failure, or across all failures. Currently the following commands are defined:
- HA_RECOVERY_ACOUNT
- This sets the maximum number of times recovery is performed
for this connection. The value is specified by passing it via
args
as an integer. A negative value implies that there is no limit on the number of times recovery will be performed, and this is the default state of the connection when it is made HA aware. - HA_RECOVERY_ICOUNT
- This sets the maximum number of iterations, recovery is performed
for this connection, each time a connection is found to have
failed. This count is reset each time the connection is
successfully recovered. The value is specified by passing it
via
args
as an integer. A negative value implies that there is no limit on the number of times recovery will be performed, and this is the default state of the connection when it is made HA aware. - HA_RECOVERY_SUSPEND
- Temporarily suspends any recovery on this connection. It will behave like a normal connection.
- HA_RECOVERY_ENABLE
- Re-enables any recovery on this connection. All other
recovery options are unaffected. This just toggles the
recovery enabled/disabled
bit. - HA_RECOVERY_RESET_ICOUNT
- Resets the iteration count used by HA_RECOVERY_ICOUNT above. This sets the internal count per iteration to zero.
- HA_RECOVERY_RESET_ACOUNT
- Resets the total count used by HA_RECOVERY_ACOUNT above. This sets the internal count of recoveries to zero.
Returns:
- 0
- Success.
- -1
- An error occurred (errno is set).
Errors:
- EBADF
- No connection is specified by this coid, or connection is not HA-aware.
- EINVAL
- Invalid command.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
Page updated:
