TsgcWebSocketServer | Server Keep Active

Once server is started and OnShutdown event is fired, sometimes server can stopped for any reason. If you want to restart server after an unexpected close, you can use WatchDog property

 

WatchDog

If WatchDog is enabled, when server detects a Shutdown, WatchDog try to restart again every X seconds until server is active again.

 

Example: restart every 10 seconds after an unexpected stop with unlimited attempts.

 


oServer = new TsgcWebSocketServer();
oServer.WatchDog.Interval = 10;
oServer.WatchDog.Attempts = 0;
oServer.WatchDog.Enabled = true;
oServer.Active = true;