Skip to content

Update EndpointOrdering Happy Eyeballs Logic - #348

Open
gakiwate wants to merge 4 commits into
apple:mainfrom
gakiwate:happy-eyeballs-core
Open

gakiwate wants to merge 4 commits into
apple:mainfrom
gakiwate:happy-eyeballs-core

Conversation

@gakiwate

Copy link
Copy Markdown
Contributor
  • orderEndpoints takes a destination comparator, a connection-use reader and a randomness source; each defaults to a built-in or a no-op.
  • Add PriorityOrigin: a priority of 0 means "none supplied" for a service binding, and the most preferred value for SRV.
  • Add orderBySRVWeight, the RFC 2782 weight-proportional draw within each priority group.
  • Add preferConnectedOrder, moving the endpoint with the most established use to the front.
  • Endpoint.priority and .weight gain setters.
  • Default Preferred Address Family Count is now 2.
  • Move the IPv6 prefix predicates to IPv6Address.swift.

- orderEndpoints takes a destination comparator, a connection-use reader
  and a randomness source; each defaults to a built-in or a no-op.
- Add PriorityOrigin: a priority of 0 means "none supplied" for a service
  binding, and the most preferred value for SRV.
- Add orderBySRVWeight, the RFC 2782 weight-proportional draw within each
  priority group.
- Add preferConnectedOrder, moving the endpoint with the most established
  use to the front.
- Endpoint.priority and .weight gain setters.
- Default Preferred Address Family Count is now 2.
- Move the IPv6 prefix predicates to IPv6Address.swift.
@gakiwate gakiwate added the 🆕 semver/minor Adds new public API. label Nov 13, 2026
- Add protocolGroups and orderEndpointGroups. Groups are alternatives, so
  they are returned as separate lists rather than one, and an endpoint
  usable over two protocols is offered in both.
- Run the SRV weighted draw before prefer-connected, which moves an entry
  to the front and would otherwise split the contiguous priority runs the
  draw reads.
- An endpoint with no IP family, a Unix-domain one included, holds its
  slot instead of disqualifying its whole run from interleaving.
- Name the default Preferred Address Family Count as a constant.
@gakiwate
gakiwate requested a review from tfpauly November 15, 2026 23:42
@gakiwate gakiwate added 🔨 semver/patch No public API change. and removed 🆕 semver/minor Adds new public API. labels Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants