DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
happy_eyeballs.h File Reference

Dual-stack destination selection + Happy Eyeballs fallback (DETWS_ENABLE_HAPPY_EYEBALLS). More...

#include "ServerConfig.h"
#include "network_drivers/network/ip.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Dual-stack destination selection + Happy Eyeballs fallback (DETWS_ENABLE_HAPPY_EYEBALLS).

On a dual-stack device (DETWS_ENABLE_IPV6), an outbound connection often has both IPv6 and IPv4 candidate addresses for the same host. RFC 8305 (Happy Eyeballs v2) says: sort them by RFC 6724 preference, interleave the families so you do not try every IPv6 before any IPv4, then start connection attempts staggered by a short "Connection Attempt Delay" and take whichever connects first. That gives fast IPv6 when it works and a quick fallback to IPv4 when it does not.

This is the pure decision layer on top of the shipped DetIp: a preference score, the ordering + family interleave over a candidate list, and the attempt-delay gate. The app owns the sockets and the DNS; this owns which address to try next, and when. No heap, no stdlib, host-testable.

Definition in file happy_eyeballs.h.