TURN Client | Send Indication

TURN Protocol supports 2 mechanisms for sending and receiving data from peers, one of them is Send and Data mechanisms.

 

The TURN client can use the SendIndication method to send data to the server for relaying to a peer. The TURN client must ensure that there is a permission for the Peer IP Address where the Send Indication will be sent.

 

The responses to a SendIndication method, are received OnTURNDataIndication event.

 


oTURN.SendIndication("80.147.23.157", 5000, "random data");

 
void OnTURNDataIndication(Component Sender, TsgcSocketConnection aSocket, 
  TsgcSTUN_Message aMessage, TsgcTURN_ResponseDataIndication aDataIndication)
{
  DoLog("#Data Indication: [" + aDataIndication.PeerIP + ":" + IntToStr(aDataIndication.PeerPort) + "] " + 
    aDataIndication.Data.ToString());
}