TsgcTURNClientEvents › OnTURNCreatePermission

OnTURNCreatePermission Event

Fires after a successful CreatePermission response for the requested peer IP.

Syntax

property OnTURNCreatePermission: TsgcTURNCreatePermissionEvent;
// TsgcTURNCreatePermissionEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aCreatePermission: TsgcTURN_ResponseCreatePermission) of object

Default Value

Remarks

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.

Example

procedure TForm1.oTURNTURNCreatePermission(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
  const aCreatePermission: TsgcTURN_ResponseCreatePermission);
begin
  DoLog('Permission installed for peer');
end;

Back to Events