Skip to content

feat: add DNS resolver and endpoint candidates - #8

Merged
zuudevs merged 9 commits into
mainfrom
feat/dns-resolver
Sep 14, 2026
Merged

zuudevs merged 9 commits into
mainfrom
feat/dns-resolver

Conversation

@zuudevs

@zuudevs zuudevs commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the v1 DNS/address-resolution layer that turns a host/port pair into owned IPv4/IPv6 TCP endpoint candidates.

Added

  • src/net/endpoint.hpp
    • internal owned sockaddr_storage value type
    • preserves family, socket type, protocol, and native address length
    • IPv4/IPv6 helpers
    • copies native address data so candidates do not depend on addrinfo lifetime
  • src/net/resolver.hpp / src/net/resolver.cpp
    • getaddrinfo-based resolution
    • AF_UNSPEC IPv4 + IPv6 discovery
    • TCP stream hints
    • preserves resolver ordering
    • frees native addrinfo through RAII
    • maps resolver/runtime failures to ErrorCode::ResolveFailed
  • src/platform/network_runtime.hpp / .cpp
    • internal network runtime bootstrap
    • Windows WSAStartup(2.2) once through function-local static RAII
    • matching WSACleanup()
    • POSIX no-op implementation
  • tests/resolver_test.cpp
    • endpoint address-copy ownership
    • numeric IPv4 loopback resolution
    • numeric IPv6 loopback resolution
    • port preservation
    • invalid/empty hostname errors

Build changes

  • compile resolver and network runtime into the internal target
  • wire resolver tests into the existing GoogleTest target

CI / determinism

Tests use numeric loopback addresses (127.0.0.1 and ::1) and do not depend on public DNS or internet connectivity.

Scope

This PR intentionally does not create sockets or attempt TCP connections. Candidate iteration, connect timeouts, partial I/O, and connection reuse belong to the upcoming TcpConnection transport work.

@zuudevs
zuudevs merged commit fda26a4 into main Sep 14, 2026
6 checks passed
@zuudevs
zuudevs deleted the feat/dns-resolver branch September 17, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant