TsgcTURNClient › Methods › ChannelBind
Binds a 16-bit channel number (0x4000-0x7FFF) to a peer for low-overhead ChannelData exchange.
procedure ChannelBind(const aPeerIP: string; aPeerPort: Word);
| Name | Type | Description |
|---|---|---|
aPeerIP | const string | IP address of the peer to bind the channel to. |
aPeerPort | Word | UDP port of the peer to bind the channel to. |
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.
oTURN.ChannelBind('203.0.113.25', 49200);