TsgcWebSocketHTTPServer › Events › OnLoadBalancerDisconnect
Fires when the server disconnects from the Load Balancer Server.
public event TsgcWSDisconnectEventHandler OnLoadBalancerDisconnect;
// delegate void TsgcWSDisconnectEventHandler(TsgcWSConnection Connection, int Code)
—
OnLoadBalancerDisconnect is raised when the side connection to the Load Balancer Server is closed, either because the server was deactivated, the Load Balancer closed the session, or the TCP connection was dropped. The Code parameter carries the WebSocket close code reported by the peer (1000 for a normal closure, 1006 for an abnormal drop...). If LoadBalancer.AutoRestart is set to a non-zero value the server will try to reconnect automatically after the configured number of seconds.
void OnLoadBalancerDisconnect(TsgcWSConnection Connection, int Code)
{
Console.WriteLine("#load balancer disconnected (code " + Code + ")");
}