TsgcWSPServer_Dataset › Events › OnFragmented
Fires for each fragment of a fragmented WebSocket message received from a client.
property OnFragmented: TsgcWSFragmentedEvent;
// TsgcWSFragmentedEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean) of object
—
Fires once per RFC 6455 fragment. OpCode marks the first fragment (opText or opBinary), subsequent fragments arrive with opContinuation. Continuation is True while more fragments are expected and False on the final fragment. Reassembly, decoding and OnMessage/OnBinary dispatch are skipped while a handler is assigned, so the application is fully responsible for collecting the fragments.
procedure TForm1.oProtocolFragmented(Connection: TsgcWSConnection;
const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean);
begin
Memo1.Lines.Add(Format('fragment: %d bytes, more=%s',
[Data.Size, BoolToStr(Continuation, True)]));
end;