TsgcWSPClient_WAMP › Events › OnFragmented
Fires for each fragment of a multi-frame WebSocket message before reassembly.
property OnFragmented: TsgcWSFragmentedEvent;
// TsgcWSFragmentedEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean) of object
—
Low-level hook useful when the server transmits very large payloads across multiple WebSocket frames. Data is the partial buffer for the current fragment, OpCode holds the original frame kind (text or binary) of the first fragment, and Continuation is True for every fragment after the first. Standard WAMP traffic is almost always unfragmented, so this event typically stays dormant unless the application negotiates streaming payloads with the peer.
procedure TForm1.WAMPFragmented(Connection: TsgcWSConnection;
const Data: TMemoryStream; const OpCode: TOpCode;
const Continuation: Boolean);
begin
Memo1.Lines.Add(Format('fragment: %d bytes (continuation=%s)',
[Data.Size, BoolToStr(Continuation, True)]));
end;