TsgcWSRateLimiterMethods › UnregisterConnection

UnregisterConnection Method

Removes a connection from tracking (called automatically on disconnect).

Syntax

procedure UnregisterConnection(const aIP: string);

Parameters

NameTypeDescription
aIPconst stringIP address of the client whose connection is being removed from tracking. Must match the value passed to the matching RegisterConnection call.

Remarks

Removes the IP from the internal connection-tracking table and decrements the ActiveKeys counter exposed through Stats. Called automatically on disconnect by the built-in server integration. Call it manually only from custom transport code that registered the connection itself — failing to unregister eventually produces a stale ActiveKeys value and may trip the connection-rate limits even though no client is actually connected.

Example

procedure TForm1.ServerDisconnect(Connection: TsgcWSConnection);
begin
  sgcWSRateLimiter1.UnregisterConnection(Connection.PeerIP);
end;

Back to Methods