← board

Networking runtime

Summary

Add a target-neutral networking API (net.pas) with platform-specific backends. Use the Synapse library as both a compiler compatibility target and correctness test suite.

Design Reference

Full design lives in devdocs/developer/plan-networking.md. Key decisions:

Analysis: Work Required

1. Compiler prerequisites (may already be in progress)

Blocker Notes
Conditional/directive parsing POSIX-profile Synapse hits missing {$IF DECLARED(...)} support
Unit resolution from source paths Dotted units such as Posix.SysSocket truncate to posix
RTL unit availability SysUtils, Classes stubs or equivalents needed
Platform-branch selection {$IFDEF LINUX} / {$IFDEF FPC} handling

2. Runtime implementation order

  1. Syscall constants + sockaddr_in struct layout for Linux x86-64.
  2. Byte-order helpers (htons, ntohs, htonl, ntohl).
  3. Thin syscall wrappers: socket, bind, listen, accept, connect, read/write, sendto/recvfrom, close, setsockopt.
  4. Public net.pas API wrapping the above.
  5. Loopback tests: TCP echo client/server, UDP send/recv.

3. Synapse compatibility milestones

Unit Current state Likely fix category
synautil default: missing libc; POSIX profile: missing posix branch selection + dotted units
synaip default: missing libc; POSIX profile: missing posix branch selection + dotted units
synsock default: missing system; POSIX profile: {$IF DECLARED(...)} parse fail branch selection + directive support
blcksock default: missing system; POSIX profile: missing system dotted units / later RTL availability

First pass: classify failures. Second pass: fix compiler blockers. Third pass: compile units successfully.

4. Test strategy

First Milestone

Linux syscall-only IPv4:

DNS deferred to feature-dns-resolver-library.

Log

Log

Umbrella status (2026-07-20, Track B sweep)

This is a strategy umbrella spanning years of milestones (own syscall socket layer, PAL backends, Synapse compatibility via the Posix.* path, cross/ESP targets), not a unit of work that can be finished in one pass. Its named milestones are done — net.pas, asyncnet, the PAL, and per the 2026-07-19 sweep note the Synapse milestone is "effectively achieved".

Its concrete open remainder is now [[feature-ipv6-complete-surface]] (accept peer address, UDP v6, asyncnet v6, AAAA, dual-stack, scopeId). Prio dropped to 20 to reflect that: rank the children, not the umbrella, so it stops presenting as available work while its actual tasks live elsewhere.

2026-07-31 — the IPv6 child is closed

[[feature-ipv6-complete-surface]] is resolved: v6 accept returns a real peer (address, port and scope id), UDP branches on family through both the PAL and net.pas, and asyncnet gained TcpListen6 / TcpConnect6 / TcpConnectAddr6. Gated by lib_net6 (extended) and the new lib_asyncnet6, both SKIP-clean on a host without AF_INET6.

Two items came back out of it as a Track U question rather than plumbing — IPV6_V6ONLY on a :: listener, and A-vs-AAAA ordering — filed as [[decide-ipv6-dualstack-and-aaaa-ordering]]. Both are choices this umbrella's design section never made, and both change observable behaviour, so they wait for a human.

2026-08-02 (Track B) — the decided items landed; this umbrella has no open children

[[decide-ipv6-dualstack-and-aaaa-ordering]] was resolved 2026-08-01, but the ticket that owned its implementation ([[feature-ipv6-complete-surface]]) was already in done/, so the decided work sat in nobody's queue for a day. Both halves are now in:

Two defects fell out of that work, both fixed with regressions: [[bug-b-dns-wire-ipv4-literal-returns-nxdomain]] (the default resolver answered NXDOMAIN for 127.0.0.1, so the facade's answer changed with the backend), and NetTcpConnectTimeout silently ignoring addr.Family (a v6 address connected to 0.0.0.0).

State of this umbrella: no open children. Its named milestones are done, its IPv6 child is closed, and its decision is implemented. The only networking tickets left in the tree are [[feature-dns-esp-backend]] (ESP-only, and not startable without an ESP runner) and [[feature-dns-libc-backend]] (done).

It is still ranked 20 and still appears in the ready queue despite its own instruction to "rank the children, not the umbrella". Whether a years-spanning strategy umbrella with zero open children should be closed, or kept open to collect future ones, is a judgment call about how this project wants its board read — flagged here rather than decided by an agent.