TsgcQUICClient › 事件 › OnQUICDisconnect

OnQUICDisconnect 事件

QUIC 连接关闭时触发。

语法

property OnQUICDisconnect: TsgcQUICDisconnectEvent;
// TsgcQUICDisconnectEvent = procedure(Sender: TObject; const Connection: TsgcQUICConnectionClient; const Code: Integer) of object

默认值

—

备注

OnQUICDisconnect 在 QUIC 连接关闭后触发,无论关闭是由应用程序请求、服务器发起还是因传输错误引起。Connection 参数公开已关闭的会话,Code 参数报告 QUIC 连接关闭代码,应用程序可将其记录或用于决定是否重新连接。

示例


procedure OnQUICDisconnectEvent(Sender: TObject; const Connection: TsgcQUICConnectionClient; const Code: Integer);
begin
  Log('QUIC disconnected, code ' + IntToStr(Code));
end;

返回事件