TsgcWebSocketFirewallMethods › UnregisterConnection

UnregisterConnection Method

Decrements the per-IP connection counter when a previously registered connection closes, freeing capacity for RateLimit.

Syntax

procedure UnregisterConnection(const aIP: string);

Parameters

NameTypeDescription
aIPconst stringIPv4 or IPv6 address of the client whose connection has been closed.

Remarks

UnregisterConnection is the counterpart to RegisterConnection and is invoked automatically by the server integration on disconnect. Each call decrements the active-connection count for the IP; the firewall never drops below zero, so extra calls are harmless. For custom transports, call it from your disconnect path exactly once per RegisterConnection to keep RateLimit counters accurate.

Example

procedure TMyTransport.OnClose(const aIP: string);
begin
  sgcWebSocketFirewall1.UnregisterConnection(aIP);
end;

Back to Methods