TsgcTCPClient › Properties › WatchDog
Automatically reconnects to the server after an unexpected disconnection.
property WatchDog: TsgcWSWatchDogClient_Options read FWatchDog write SetWatchDog;
Enabled=False, Interval=10, Attempts=0
When WatchDog.Enabled is True, the client detects a dropped connection and tries to reconnect every Interval seconds. Attempts controls the maximum number of reconnect attempts; zero means unlimited retries. Use the OnBeforeWatchDog event to customise the reconnection flow, for example to fall back to a secondary server or cancel the retry by setting Handled to True.
oTCP := TsgcTCPClient.Create(nil);
oTCP.WatchDog.Interval := 10;
oTCP.WatchDog.Attempts := 0;
oTCP.WatchDog.Enabled := true;
oTCP.Active := true;