TsgcWSPClient_sgcEvents › OnFragmented

OnFragmented Event

Fires for fragmented WebSocket frames, exposing OpCode and continuation flag.

Syntax

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

Default Value

Remarks

Triggered once per fragment when the server sends a message that is split across several frames. OpCode identifies whether the fragment is text or binary; Continuation is True while more fragments are expected and False on the final fragment.

Example

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;

Back to Events