Xirsys.XTurn.Channels.Channel (xturn v2.0.0)

Copy Markdown View Source

In-memory TURN channel binding for one peer on an allocation.

What problem this solves

Each ChannelBind creates state the allocation worker must refresh before expiry. This struct holds the channel number, owning 5-tuple, peer address, and the refresh timer reference.

Internal

Used inside allocation workers; not part of the public application API.

RFCs

  • RFC 5766 - channel bindings and refresh (pt.11)

Summary

Types

Channel number in the range 0x4000-0x7FFE, or nil before bind.

Bound peer {ip, port}.

t()

Channel binding held by an allocation worker.

Reference for the channel refresh timer, or nil.

Allocation 5-tuple map used as the binding scope.

Types

channel_id()

@type channel_id() :: non_neg_integer() | nil

Channel number in the range 0x4000-0x7FFE, or nil before bind.

peer_address()

@type peer_address() :: {:inet.ip_address(), pos_integer()} | nil

Bound peer {ip, port}.

t()

@type t() :: %Xirsys.XTurn.Channels.Channel{
  id: channel_id(),
  peer_address: peer_address(),
  timer: timer_ref(),
  tuple5: tuple5()
}

Channel binding held by an allocation worker.

Fields

  • :id - channel number (0x4000-0x7FFE), or nil before bind
  • :tuple5 - owning allocation 5-tuple map, or nil
  • :peer_address - bound peer {ip, port}, or nil
  • :timer - refresh timer reference, or nil

timer_ref()

@type timer_ref() :: reference() | nil

Reference for the channel refresh timer, or nil.

tuple5()

@type tuple5() :: map() | nil

Allocation 5-tuple map used as the binding scope.