TsgcWebSocketServer | Server Keep Connections Alive

Once your client has connected to server, sometimes connection can be closed due to poor signal, connection errors... use to keep connection alive.

 

property allows to send a Ping every X seconds to maintain connection alive. Some servers, close TCP connections if there is no data exchanged between peers. solves this problem, sending a ping every a specific interval. Usually this is enough to maintain a connection active, but you can set a TimeOut interval if you want to close connection if a response from client is not received after X seconds.

 

Example: send a ping to all connected clients every 30 seconds


oServer = new TsgcWebSocketServer();
oServer..Interval = 30;
oServer..Timeout = 0;
oServer..Enabled = true;
oServer.Active = true;