Skip to content

Integrate async tasks with std::net readiness and Windows IOCP #445

Open

Description

@LunaStev

Parent: #439
Depends on: #444 and the portable std::net::event foundation merged in #438.

Summary

Integrate async task wakeups with portable network readiness while keeping HTTP, TLS, and protocol policy outside std::net.

Scope

  • Adapt Linux epoll, Darwin/FreeBSD kqueue, and the existing Windows readiness provider to wake registered tasks.
  • Define registration ownership, token lifetime, deregistration, timeout, cancellation, close, error, and hangup behavior.
  • Preserve final readable data when readable and hangup arrive together.
  • Prevent stale events from waking a reused task or descriptor registration.
  • Add an IOCP completion provider for Windows when the runtime's buffer ownership and cancellation contracts are available.
  • Keep synchronous std::net APIs operational and avoid forcing an executor on non-async programs.
  • Expose primitives sufficient for external HTTP, DNS, TLS, and protocol libraries without adding those protocols to std.

Completion criteria

  • Async connect, accept, read, write, timeout, cancellation, and close have deterministic tests.
  • epoll and kqueue wake paths pass hosted CI on their native systems.
  • Windows distinguishes the bounded readiness fallback from the IOCP completion backend.
  • Buffer ownership remains valid until an IOCP operation completes or cancellation is acknowledged.
  • No busy polling is required for an idle executor.
  • Synchronous networking regression tests remain green.

This is a high-difficulty cross-platform runtime task, not a good first issue.

Implementation audit — 2026-09-23

std/task/net.wave contains separate readiness and Windows completion paths, with synchronous networking examples/regressions still passing. Linux async TCP fixtures pass. Native cross-platform wake/cancellation/buffer-lifetime acceptance still needs focused evidence; #534 tracks IOCP allocation bounds. Do not infer full completion from the presence of the providers.

Activity

  1. added
    enhancement
    help wanted
    cross-platform
    on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-platformenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions