TsgcWSCircuitBreaker › Methods › RecordMessageSuccess
Server-side hook that records a successful message on ServerKey.
procedure RecordMessageSuccess(const aIP: string);
| Name | Type | Description |
|---|---|---|
aIP | const string | Peer IP address of the connection that delivered the message. Accepted for logging and future per-IP metrics; the actual accounting goes against ServerKey. |
WebSocket-message flavored success recorder for server-side self-protection. Delegates to RecordSuccess(ServerKey) — the IP parameter is currently informational and is used by future per-IP metrics. Call from the server's OnMessage handler after the message has been processed successfully so the breaker can evaluate its HalfOpen -> Closed transition if the server was recovering. Returns immediately when Enabled is False.
procedure TForm1.WSServerMessage(Connection: TsgcWSConnection;
const Text: string);
begin
try
HandleMessage(Text);
sgcWSCircuitBreaker1.RecordMessageSuccess(Connection.PeerIP);
except
on E: Exception do
sgcWSCircuitBreaker1.RecordMessageError(Connection.PeerIP, E.Message);
end;
end;