TsgcTURNClient › Events › OnTURNChannelData
Fires when the client receives a ChannelData message relayed from a peer bound to a channel.
property OnTURNChannelData: TsgcTURNDataChannelEvent;
// TsgcTURNDataChannelEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aChannelData: TsgcTURNChannelData) of object
—
Fires whenever the TURN server forwards a ChannelData message (RFC 5766 section 11.6) received from a peer that has a live channel binding. Read aChannelData.ChannelID to identify the peer associated with the binding and aChannelData.Data for the payload bytes. ChannelData has a 4-byte header only, so this event is the low-overhead counterpart to OnTURNDataIndication and is the preferred path for high-rate media.
procedure TForm1.oTURNTURNChannelData(Sender: TObject;
const aSocket: TsgcSocketConnection;
const aChannelData: TsgcTURNChannelData);
begin
DoLog('Channel ' + IntToStr(aChannelData.ChannelID) +
', ' + IntToStr(Length(aChannelData.Data)) + ' bytes');
end;