TsgcWSPClient_DatasetEvents › OnBinary

OnBinary Event

Fires when a binary frame arrives; payload is delivered as a TMemoryStream.

Syntax

property OnBinary: TsgcWSBinaryEvent;
// TsgcWSBinaryEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream) of object

Default Value

Remarks

Data owns the payload and is valid only during the handler. Copy its contents before the handler returns if you need to process the bytes later.

Example

procedure TForm1.oProtocolBinary(Connection: TsgcWSConnection; const Data: TMemoryStream);
begin
  Memo1.Lines.Add(Format('binary: %d bytes', [Data.Size]));
end;

Back to Events