TsgcTURNClient › Events › OnTURNChannelBind
Fires after a successful ChannelBind response; exposes the channel number assigned to the peer.
property OnTURNChannelBind: TsgcTURNChannelBindEvent;
// TsgcTURNChannelBindEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aChannelBind: TsgcTURN_ResponseChannelBind) of object
—
Fires when the TURN server confirms a ChannelBind request. Read aChannelBind.ChannelID (range 0x4000-0x7FFF) to obtain the channel number assigned to the peer; this is the value to pass to SendChannelData when relaying traffic to that peer with the compact 4-byte ChannelData framing. The binding also implicitly installs a peer permission and must be refreshed before 10 minutes elapse.
procedure TForm1.oTURNTURNChannelBind(Sender: TObject;
const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
const aChannelBind: TsgcTURN_ResponseChannelBind);
begin
DoLog('Channel bound, id: ' + IntToStr(aChannelBind.ChannelID));
end;