TsgcTURNClientMethods › Clear

Clear Method

Resets the client state, releasing cached allocation, permissions and channel bindings.

Syntax

procedure Clear;

Remarks

Empties the internal caches that track the current allocation (relayed IP/port, lifetime, nonce), the active permissions and the channel bindings, and stops the AutoRefresh timer. The method does not send DEALLOCATE to the server; call Refresh(0) first if you want the relay released cleanly.

Use Clear after a connection-level error or when reconfiguring the component against a different TURN server to ensure a fresh authentication handshake on the next Allocate.

Example

oTURN.Refresh(0);
oTURN.Clear;
oTURN.Host := 'turn2.sgcwebsockets.com';
oTURN.Allocate;

Back to Methods