TsgcWSPServer_WAMP › Events › OnBinary
Fires when a client sends a binary WebSocket frame that is not part of the standard WAMP v1 text protocol.
property OnBinary: TsgcWSBinaryEvent;
// TsgcWSBinaryEvent = procedure(Connection: TsgcWSConnection; const Data: TMemoryStream) of object
—
WAMP v1 is a JSON-over-text protocol so no binary frame is ever required by the spec. This handler is the escape hatch for application-specific payloads that ride over the same socket (file uploads, compressed batches, custom telemetry). The stream position is at zero on entry; the buffer is owned by the component and will be released when the handler returns — copy any bytes you need before that.
procedure TForm1.WAMPServerBinary(Connection: TsgcWSConnection;
const Data: TMemoryStream);
begin
Memo1.Lines.Add(Format('[%s] binary upload: %d bytes',
[Connection.Guid, Data.Size]));
end;