TsgcWebSocketClient › Properties › WatchDog
Automatically reconnects to the server after an unexpected disconnection.
public TsgcWSWatchDogClient_Options WatchDog { get; set; }
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.
oClient = new TsgcWebSocketClient();
oClient.WatchDog.Interval = 10;
oClient.WatchDog.Attempts = 0;
oClient.WatchDog.Enabled = true;
oClient.Active = true;