TsgcWSPClient_sgc事件 › OnFragmented

OnFragmented 事件

对分片 WebSocket 帧触发,公开 OpCode 和续帧标志。

语法

property OnFragmented: TsgcWSFragmentedEvent;
// TsgcWSFragmentedEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean) of object

默认值

备注

每当服务器发送跨多帧分片的消息时,每个片段触发一次。OpCode 标识片段是文本还是二进制;当还有更多片段时,Continuation 为 True,最终片段时为 False。

示例

procedure TForm1.oProtocolFragmented(Connection: TsgcWSConnection;
  const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean);
begin
  if not Continuation then
    Memo1.Lines.Add('final fragment received');
end;

返回事件