TsgcWSPServer_WAMP › Events › OnFragmented
Fires for each fragment of a multi-frame WebSocket message received from a client before the payload is reassembled.
property OnFragmented: TsgcWSFragmentedEvent;
// TsgcWSFragmentedEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean) of object
—
Low-level diagnostic hook used when a client transmits large payloads across multiple WebSocket frames. Data is the buffer for the current fragment, OpCode holds the original kind (text or binary) from the first fragment, and Continuation is True for every fragment after the first. Ordinary WAMP traffic fits in a single frame so this event is normally silent; it becomes useful when negotiating streaming payloads or for bandwidth analysis during protocol debugging.
procedure TForm1.WAMPServerFragmented(Connection: TsgcWSConnection;
const Data: TMemoryStream; const OpCode: TOpCode;
const Continuation: Boolean);
begin
Memo1.Lines.Add(Format('[%s] fragment: %d bytes (continuation=%s)',
[Connection.Guid, Data.Size, BoolToStr(Continuation, True)]));
end;