TsgcTURNClient › Events › OnTURNRefresh
Fires after a successful REFRESH response, reporting the new allocation lifetime.
property OnTURNRefresh: TsgcTURNRefreshEvent;
// TsgcTURNRefreshEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aRefresh: TsgcTURN_ResponseRefresh) of object
—
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.
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;