TsgcTURNClient › Events › OnTURNCreatePermission
Fires after a successful CreatePermission response for the requested peer IP.
property OnTURNCreatePermission: TsgcTURNCreatePermissionEvent;
// TsgcTURNCreatePermissionEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aCreatePermission: TsgcTURN_ResponseCreatePermission) of object
—
Fires when the TURN server confirms that a 5-minute permission has been installed for the peer IP passed to CreatePermission. Once this event has been received the client can safely send SEND Indications to the peer with SendIndication. The permission must be refreshed before it expires; with TURNOptions.AutoRefresh.Permissions enabled this happens automatically.
procedure TForm1.oTURNTURNCreatePermission(Sender: TObject;
const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
const aCreatePermission: TsgcTURN_ResponseCreatePermission);
begin
DoLog('Permission installed for peer');
end;