TsgcTURNClientMethods › SendIndication

SendIndication Method

Sends a datagram to a peer wrapped in a SEND Indication (requires an active permission).

Overloads

Overload 1

Syntax

procedure SendIndication(const aPeerIP: string; aPeerPort: Word; const aData: string);

Parameters

NameTypeDescription
aPeerIPconst stringIP address of the destination peer (must have an active permission).
aPeerPortWordUDP port of the destination peer.
aDataconst stringText payload to relay; converted to UTF-8 bytes before being wrapped in the SEND Indication.

Remarks

Wraps the payload in a SEND Indication (RFC 5766 section 10) and forwards it through the allocation to the specified peer. SEND Indications are unreliable and require that a prior CreatePermission has installed a permission for aPeerIP; otherwise the server drops the message.

Example

oTURN.CreatePermission('203.0.113.25');
oTURN.SendIndication('203.0.113.25', 49200, 'hello');

Overload 2

Syntax

procedure SendIndication(const aPeerIP: string; aPeerPort: Word; const aData: TBytes);

Parameters

NameTypeDescription
aPeerIPconst stringIP address of the destination peer (must have an active permission).
aPeerPortWordUDP port of the destination peer.
aDataconst TBytesRaw byte payload to relay; used verbatim inside the SEND Indication.

Remarks

Binary-payload variant of the SEND Indication. Use this overload for non-text content (media, serialized packets, encrypted blobs) where the string form would corrupt the data with an encoding round-trip. Like the string overload, an active permission is required for aPeerIP.

Example

var
  vPayload: TBytes;
begin
  SetLength(vPayload, 4);
  vPayload[0] := $DE; vPayload[1] := $AD; vPayload[2] := $BE; vPayload[3] := $EF;
  oTURN.CreatePermission('203.0.113.25');
  oTURN.SendIndication('203.0.113.25', 49200, vPayload);
end;

Back to Methods