TsgcWSPClient_E2EE › Methods › WriteData
Sends raw text or a stream through the underlying WebSocket connection.
procedure WriteData(const aText: String);
| Name | Type | Description |
|---|---|---|
aText | const String | Raw text payload to write to the WebSocket. |
Low-level escape hatch that writes aText verbatim through the underlying WebSocket connection. The payload is not encrypted by the E2EE layer and is not wrapped in the direct/group message envelope. Use this method only to extend the protocol or to interact with server-side custom frames; for normal messaging call SendDirectMessage or SendGroupMessage.
oE2EE.WriteData('custom-frame');
procedure WriteData(aStream: TStream; aSize: Integer = 0; const aStreaming: TwsStreaming = stmNone);
| Name | Type | Description |
|---|---|---|
aStream | TStream | Stream whose contents are written to the WebSocket. |
aSize | Integer | Number of bytes to send. Use 0 to send the entire stream. |
aStreaming | const TwsStreaming | Framing mode used for the transfer (stmNone for a single binary frame). |
Binary variant of WriteData. Sends the stream content as raw WebSocket frames without applying E2EE encryption or the direct/group envelope. Intended for custom extensions and interoperability with server-side handlers that consume raw frames; prefer the encrypted Send* methods for normal E2EE messaging.
oStream := TFileStream.Create('blob.bin', fmOpenRead);
try
oE2EE.WriteData(oStream);
finally
oStream.Free;
end;