TsgcWSPServer_FilesEvents › OnBinary

OnBinary Event

Fired when a raw binary frame is received from a client.

Syntax

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

Default Value

Remarks

The Files subprotocol consumes binary frames to reassemble incoming files, so this event is normally only useful for diagnostics. The Data stream position is at zero and is valid for the duration of the callback.

Example

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

Back to Events