TsgcTURNClient › Methods › WriteData
Writes raw bytes directly on the underlying TURN transport; used for custom payloads and diagnostics.
procedure WriteData(const aBytes: TBytes);
| Name | Type | Description |
|---|---|---|
aBytes | const TBytes | Bytes to write verbatim on the transport to the configured Host/Port. |
Low-level escape hatch that writes the byte array directly on the socket connected to the TURN server without any STUN/TURN framing. Intended for diagnostics, custom attribute experiments and for replaying captured traces. Typical applications should use SendIndication or SendChannelData instead.
var
vRaw: TBytes;
begin
vRaw := TEncoding.UTF8.GetBytes('diagnostic');
oTURN.WriteData(vRaw);
end;
procedure WriteData(const aIPAddress: string; aPort: Word; const aBytes: TBytes);
| Name | Type | Description |
|---|---|---|
aIPAddress | const string | Destination IP address; useful when the UDP socket talks to multiple endpoints. |
aPort | Word | Destination UDP port. |
aBytes | const TBytes | Bytes to write verbatim on the transport towards aIPAddress:aPort. |
Variant that targets an explicit destination instead of the configured Host/Port. Used internally when the allocation needs to address a different server (for example after a 300 Try Alternate redirect) and exposed here for advanced scenarios such as hairpinning tests.
oTURN.WriteData('198.51.100.10', 3478, vRaw);