Expand description
Server-side socket choices, which belong to the driver and not to the engine: port ranges, which local addresses get candidates, and one UDP port or one ICE-TCP listening port shared by many peer connections.
A shared port works because every ICE connectivity check names its recipient: the USERNAME
of a Binding request is <receiver's ufrag>:<sender's ufrag> (RFC 8445 section 7.2.2). The
first request from a remote address says which peer connection it is for
(UfragMux::route); everything else from that address follows it. Each peer connection
registers its local ufrags (RTCPeerConnection::ice_username_fragments: one per transport,
several when sections are not bundled) after each local description, an ICE restart’s new
ones included. Inside the peer connection the engine does the same between its transports:
what the shared port brings goes to the transport whose ufrag the first check names.
Structs§
- Address
Filter - Which local addresses get host candidates.
- Port
Range - An inclusive range of ports for the sockets a peer connection gets.
- Shared
Accept - A connection accepted on an ICE-TCP listening port shared by many peer connections, with the ufrag its first check names.
- Ufrag
Mux - Routes what arrives on a shared port to the peer connection it is for: by the receiver’s ufrag of the first Binding request from an address, then by that address.
Functions§
- accept_
by_ ufrag - Accepts the next connection on a shared ICE-TCP port and reads its first RFC 4571 frame
(for
timeoutat most) to learn which peer connection it is for. Connections whose first frame is not a Binding request with a USERNAME are dropped and the next one is awaited. - bind_
runtime_ udp_ in_ range - A UDP socket of
runtimeonip, on a free port ofrange, skipping refused ports asbind_udp_in_rangedoes. - bind_
tcp_ listener_ in_ range - A TCP listener of
runtimeonip, on a free port ofrange. - bind_
udp_ in_ range - A UDP socket on
ip, on a free port ofrange. Ports the host refuses (an excluded port range on Windows, a privileged port) are skipped like ports in use. - binding_
request_ ufrags - The ufrags of a STUN Binding request:
(receiver, sender)from its USERNAME (RFC 8445 section 7.2.2).Nonefor anything else. - set_
traffic_ class - Sets the byte the socket’s packets carry in the IPv4 TOS / IPv6 Traffic Class field: the
DSCP in its upper six bits (RFC 2474 section 3), the ECN codepoint in the lower two (RFC
3168 section 5).
ipv6says which option (IPV6_TCLASSorIP_TOS) the socket’s family takes. - traffic_
class - The byte the socket’s packets carry in the IPv4 TOS / IPv6 Traffic Class field, as the
operating system reports it (
getsockoptofIP_TOS/IPV6_TCLASS).
Type Aliases§
- Interface
Filter - Keeps an interface by name.
- IpFilter
- Keeps an address.