|
APIs, concepts, guides, and more
|
| void NetworkSyncGroupRecover | ( | int32_t | groupId, |
| uint32_t | timeoutMilliseconds = NetworkSyncGroupRecoverTimeoutMillisecondsDefault ) |
Recovery raises an error instead of guessing when it cannot succeed:
If recovery fails (an exception, or a logged error with ThrowExceptions(false)), the method returns with the group's prior state restored so the failure remains visible.
The call blocks until the recovery succeeds or fails. timeoutMilliseconds is a wall-clock deadline for each AL transition of each member node, so the worst case is roughly (member nodes) x 2 x timeoutMilliseconds, plus a fixed 2 s wait for the Working Counter confirmation; size the timeout accordingly. Each individual service-channel operation can overshoot a deadline by up to twice the SDO timeout (see SDOTimeoutMillisecondsDefault) under service-channel contention.
Concurrency: the method does not hold the controller lock while it polls. Recovering different groups from different threads is allowed; calling it again for the same group while a recovery is in flight raises an error. That same-group protection is per process (calls from separate processes attached to the same controller are not serialized). While any recovery is in flight, Reset and Refresh raise an error instead of deleting the node objects the recovery is using; do not Delete the controller during a recovery. See Sync Groups for the full concept.
| groupId | Non-zero sync group to recover, in the range (0, NetworkSyncGroupCountMaximum). |
| timeoutMilliseconds | Per-node AL-transition timeout in milliseconds. (Default: NetworkSyncGroupRecoverTimeoutMillisecondsDefault) |