TsgcTURNClientMethods › ChannelBind

ChannelBind Method

Binds a 16-bit channel number (0x4000-0x7FFF) to a peer for low-overhead ChannelData exchange.

Syntax

procedure ChannelBind(const aPeerIP: string; aPeerPort: Word);

Parameters

NameTypeDescription
aPeerIPconst stringIP address of the peer to bind the channel to.
aPeerPortWordUDP port of the peer to bind the channel to.

Remarks

Sends a ChannelBind request (RFC 5766 section 11). The TURN server allocates a fresh channel number in the reserved range 0x4000-0x7FFF and associates it with the peer transport address, also installing an implicit permission. Subsequent traffic can then use the compact ChannelData framing (4-byte header) via SendChannelData instead of the heavier SEND Indication (36+ byte header).

Channel bindings last 10 minutes and must be refreshed to stay alive; when TURNOptions.AutoRefresh.Channels is enabled the component reissues ChannelBind automatically. On success the event OnTURNChannelBind fires with the assigned channel number.

Example

oTURN.ChannelBind('203.0.113.25', 49200);

Back to Methods