TsgcWSPClient_FilesEvents › OnFragmented

OnFragmented Event

Fires for every fragmented WebSocket frame passing through the Files subprotocol transport.

Syntax

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

Default Value

Remarks

Continuation is False for the first fragment and True for subsequent ones; OpCode identifies the frame type. The subprotocol itself processes fragmented messages internally, so this event is mainly useful for diagnostics and custom handling when FragmentedMessages is set to frgOnlyFragmented.

Example

procedure TForm1.oProtocolFragmented(Connection: TsgcWSConnection;
  const Data: TMemoryStream; const OpCode: TOpCode; const Continuation: Boolean);
begin
  Memo1.Lines.Add(Format('fragment %d bytes cont=%s', [Data.Size, BoolToStr(Continuation, True)]));
end;

Back to Events