TsgcWebSocketHTTPServerEvents › OnLoadBalancerDisconnect

OnLoadBalancerDisconnect Event

Fires when the server disconnects from the Load Balancer Server.

Syntax

public event TsgcWSDisconnectEventHandler OnLoadBalancerDisconnect;
// delegate void TsgcWSDisconnectEventHandler(TsgcWSConnection Connection, int Code)

Default Value

Remarks

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.

Example


void OnLoadBalancerDisconnect(TsgcWSConnection Connection, int Code)
{
  Console.WriteLine("#load balancer disconnected (code " + Code + ")");
}

Back to Events