Skip to main content

Module net

Module net 

Source
Expand description

TCP dial (async DNS + Happy Eyeballs multi-address connect). TCP dial helpers (Rules Rust — rede).

Product surface is SSH client + optional local tunnel listener. This module owns dual-stack DNS resolution and Happy Eyeballs-style connect so callers never stick on a blackholed first address (addrs.next().unwrap() antipattern).

  • DNS: async via tokio::net::lookup_host (cancelable with outer timeouts).
  • Dial: try all resolved [SocketAddr]s; race families with a short delay (RFC 8305-inspired) and abort losers on first success.
  • Workload: pure I/O; no CPU fan-out, no Rayon.

Functions§

dial_tcp
Resolve host:port and dial with multi-address Happy Eyeballs racing.
interleave_address_families
Interleave IPv6 and IPv4 candidates (IPv6 first within each pair).