TsgcTURNClientMethods › Refresh

Refresh Method

Sends a REFRESH request to extend (or end) the current allocation lifetime.

Syntax

procedure Refresh(aLifetime: Cardinal);

Parameters

NameTypeDescription
aLifetimeCardinalRequested lifetime in seconds. Pass 0 to terminate the current allocation immediately; pass any positive value to extend it.

Remarks

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.

Example

// Extend the allocation for another 600 seconds.
oTURN.Refresh(600);

// Release the allocation immediately.
oTURN.Refresh(0);

Back to Methods