TsgcTURNClient › Methods › Refresh
Sends a REFRESH request to extend (or end) the current allocation lifetime.
procedure Refresh(aLifetime: Cardinal);
| Name | Type | Description |
|---|---|---|
aLifetime | Cardinal | Requested lifetime in seconds. Pass 0 to terminate the current allocation immediately; pass any positive value to extend it. |
Sends a REFRESH request (RFC 5766 section 7) against the current allocation. The server validates authentication and returns the accepted lifetime in the response; the event OnTURNRefresh fires when the refresh is granted.
When TURNOptions.AutoRefresh.Allocations is enabled the component issues Refresh automatically before expiration, so calling this method manually is usually only needed to override the cadence or to deallocate with aLifetime = 0.
// Extend the allocation for another 600 seconds.
oTURN.Refresh(600);
// Release the allocation immediately.
oTURN.Refresh(0);