TsgcWebSocketFirewall › Methods › RegisterConnection
Records a new accepted connection for the given IP, incrementing the per-IP counters used by RateLimit and feeding the ThreatScore decay window.
procedure RegisterConnection(const aIP: string);
| Name | Type | Description |
|---|---|---|
aIP | const string | IPv4 or IPv6 address of the client whose connection has just been accepted. |
RegisterConnection is invoked automatically by the server integration right after IsConnectionAllowed returns True. Call it yourself only when wiring the firewall into a custom transport that bypasses the built-in servers. Every call must be balanced by a matching UnregisterConnection on disconnect, otherwise the rate-limit counters grow unbounded.
// manual wiring for a custom transport
procedure TMyTransport.OnAccept(const aIP: string);
begin
sgcWebSocketFirewall1.RegisterConnection(aIP);
end;