TsgcWSRateLimiter › Methods › RegisterConnection
Registers a new connection for tracking (called automatically by the server).
procedure RegisterConnection(const aIP: string);
| Name | Type | Description |
|---|---|---|
aIP | const string | IP address of the client whose connection is being registered. Used as the tracking key inside the internal connection table. |
Adds the IP to the internal connection-tracking table and increments the ActiveKeys counter exposed through Stats. When the rate limiter is assigned to a server's RateLimiter property this is called automatically after IsConnectionAllowed returns True. Call it manually only from custom transport code where the built-in integration is not available. Always pair each RegisterConnection with a matching UnregisterConnection on disconnect to avoid stale counters.
procedure TForm1.ServerConnect(Connection: TsgcWSConnection);
begin
sgcWSRateLimiter1.RegisterConnection(Connection.PeerIP);
end;