TsgcTURNClientEvents › OnTURNRefresh

OnTURNRefresh Event

Fires after a successful REFRESH response, reporting the new allocation lifetime.

Syntax

property OnTURNRefresh: TsgcTURNRefreshEvent;
// TsgcTURNRefreshEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aRefresh: TsgcTURN_ResponseRefresh) of object

Default Value

Remarks

Fires when the TURN server answers a Refresh request with a success response. Read aRefresh.Lifetime to obtain the lifetime the server actually granted; this may be lower than the value requested in TURNOptions.Allocation.Lifetime. When aRefresh.Lifetime is 0 the allocation has been released.

Example

procedure TForm1.oTURNTURNRefresh(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
  const aRefresh: TsgcTURN_ResponseRefresh);
begin
  DoLog('Allocation refreshed, lifetime: ' + IntToStr(aRefresh.Lifetime));
end;

Back to Events