TsgcRTCPeerConnection › Methods › WriteData
Sends data to the remote peer through the negotiated candidate pair.
procedure WriteData(const aText: string);
| Name | Type | Description |
|---|---|---|
aText | const string | UTF-8 payload to transmit to the remote peer. |
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.
procedure TForm1.oRTCConnect(Sender: TObject;
const aCandidatePair: TsgcICE_CandidatePair);
begin
oRTC.WriteData('Hello peer!');
end;