TsgcWSPClient_E2EEMethods › WriteData

WriteData Method

Sends raw text or a stream through the underlying WebSocket connection.

Overloads

Overload 1

Syntax

procedure WriteData(const aText: String);

Parameters

NameTypeDescription
aTextconst StringRaw text payload to write to the WebSocket.

Remarks

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.

Example

oE2EE.WriteData('custom-frame');

Overload 2

Syntax

procedure WriteData(aStream: TStream; aSize: Integer = 0; const aStreaming: TwsStreaming = stmNone);

Parameters

NameTypeDescription
aStreamTStreamStream whose contents are written to the WebSocket.
aSizeIntegerNumber of bytes to send. Use 0 to send the entire stream.
aStreamingconst TwsStreamingFraming mode used for the transfer (stmNone for a single binary frame).

Remarks

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.

Example

oStream := TFileStream.Create('blob.bin', fmOpenRead);
try
  oE2EE.WriteData(oStream);
finally
  oStream.Free;
end;

Back to Methods