TsgcWSPServer_WebRTC › Events › OnFragmented
Fires for each fragment of a multi-frame WebSocket message received from a peer 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 peer 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 signalling envelopes (SDP, ICE candidates) fit in a single frame, so this event is normally silent; it becomes useful for bandwidth analysis or when a custom client streams large non-signalling payloads over the same socket.
procedure TForm1.WebRTCServerFragmented(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;