TsgcTURNClientEvents › OnTURNDataIndication

OnTURNDataIndication Event

Fires when the client receives a DATA Indication relayed from a peer that has no bound channel.

Syntax

property OnTURNDataIndication: TsgcTURNDataIndicationEvent;
// TsgcTURNDataIndicationEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aDataIndication: TsgcTURN_ResponseDataIndication) of object

Default Value

Remarks

Fires when a peer has sent traffic to the relayed transport address and the TURN server delivers it to the client as a DATA Indication (RFC 5766 section 10.3). This is the inbound counterpart of SendIndication and is used for peers that do not have an active channel binding. Read aDataIndication.PeerIP, aDataIndication.PeerPort and aDataIndication.Data to process the payload; once a channel is bound later indications for the same peer arrive via OnTURNChannelData instead.

Example

procedure TForm1.oTURNTURNDataIndication(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
  const aDataIndication: TsgcTURN_ResponseDataIndication);
begin
  DoLog('Data from ' + aDataIndication.PeerIP + ':' +
        IntToStr(aDataIndication.PeerPort) +
        ', ' + IntToStr(Length(aDataIndication.Data)) + ' bytes');
end;

Back to Events