TsgcRTCPeerConnectionMethods › WriteData

WriteData Method

Sends data to the remote peer through the negotiated candidate pair.

Syntax

procedure WriteData(const aText: string);

Parameters

NameTypeDescription
aTextconst stringUTF-8 payload to transmit to the remote peer.

Remarks

Routes the supplied payload through the candidate pair that was nominated by ICE. The transport chosen depends on the remote candidate type:

Call WriteData only after OnRTCConnect has fired; writing before a candidate pair is nominated is silently ignored.

Example

procedure TForm1.oRTCConnect(Sender: TObject;
  const aCandidatePair: TsgcICE_CandidatePair);
begin
  oRTC.WriteData('Hello peer!');
end;

Back to Methods