TsgcWSCircuitBreaker › 方法 › UnregisterConnection
服务器端钩子,停止跟踪已断开连接的连接(RegisterConnection 的对应方)。
procedure UnregisterConnection(const aIP: string);
| 名称 | 类型 | 描述 |
|---|---|---|
aIP | const string | 刚关闭的连接的对端 IP 地址。 |
当前作为空操作实现的保留钩子,与 RegisterConnection 配对,为未来的按 IP 指标预留。请从服务器的 OnDisconnect 处理程序调用,以使每个 RegisterConnection 都有对应的 UnregisterConnection。现在调用是安全的,保证向前兼容,不会产生可观察到的行为变化。
procedure TForm1.WSServerDisconnect(Connection: TsgcWSConnection);
begin
sgcWSCircuitBreaker1.UnregisterConnection(Connection.PeerIP);
end;