Skip to main content

Module bind

Module bind 

Source
Expand description

Dual-stack socket binding.

Quinn uses a single socket and relies on the OS to route both address families. On Linux an [::] socket accepts IPv4 too, but Windows defaults IPV6_V6ONLY to on, so an IPv6 socket silently drops every IPv4 packet. The helpers here clear that before binding, so a relay on [::] is reachable over IPv4 and a dual-stack client can dial IPv4 servers (via IPv4-mapped addresses; the client’s address-family matching lives in util::pick_addr). See https://github.com/moq-dev/moq/issues/1375.

Functions§

tcp
Bind a TCP listener, making an IPv6 socket dual-stack so it also serves IPv4.
udp
Bind a UDP socket, making an IPv6 socket dual-stack so it also serves IPv4.