TsgcWSPClient_STOMP_RabbitMQ › Methods › WriteData
Writes raw text or stream data over the underlying WebSocket connection.
procedure WriteData(const aText: String);
| Name | Type | Description |
|---|---|---|
aText | const String | Raw payload to send as a text WebSocket frame. The STOMP layer is bypassed, so the caller is responsible for producing a valid STOMP frame when one is required. |
Low-level escape hatch used to send text payloads that the STOMP layer does not model directly (custom frames, diagnostics, etc.). Prefer the Publish* / Subscribe* helpers for regular STOMP traffic.
sgcRabbitMQ.WriteData('custom-frame');
procedure WriteData(aStream: TStream; aSize: Integer = 0; const aStreaming: TwsStreaming = stmNone);
| Name | Type | Description |
|---|---|---|
aStream | TStream | Binary source to send. The stream is read starting at its current position. |
aSize | Integer | Number of bytes to send from the stream. When 0 (default) the component sends from the current position until the end of the stream. |
aStreaming | const TwsStreaming | Fragmentation mode: stmNone sends a single binary frame; other values split the payload into a sequence of continuation frames, useful for very large streams. |
Binary overload intended for low-level transport scenarios (file transfer, custom binary protocols layered on top of the same WebSocket connection). The STOMP layer is bypassed.
var
oStream: TFileStream;
begin
oStream := TFileStream.Create('payload.bin', fmOpenRead);
try
sgcRabbitMQ.WriteData(oStream, 0, stmNone);
finally
oStream.Free;
end;
end;