Skip to content

INT-03 follow-up: socket recv/send/accept primitives — byte-level buffer marshalling #487

Description

@hyperpolymath

ADR-015 S6b shipped net_shutdown (lowers to wasi_snapshot_preview1.sock_shutdown; command-adapter bridges to wasi:sockets/tcp) — the on-ramp. Larger socket primitives sock_recv / sock_send / sock_accept need byte-level buffer and network-address marshalling that goes beyond what S6b shipped.

Pattern is settled: the byte-level wasm IR (I32Load8U/I32Store8 and siblings) landed in #339 alongside env_at/arg_at and is what unblocks this. Helper shape will mirror gen_str_at_via_get (lib/wasi_runtime.ml): allocate iovec + byte buffer, call the WASI import, copy bytes into a length-prefixed AS string for the recv side; for send, walk the AS string into an iovec; for accept, read the new fd + remote-addr fields.

Effect surface stays Net (reserved at S6b). Component adapter already bridges to wasi:sockets/tcp internally — no host-side wasi:sockets/* requirement.

Ledger: INT-03 follow-up (S2 important — not substrate-blocking; the on-ramp suffices for net_shutdown consumers today). Refs #180.

Activity

  1. hyperpolymath commented on Sep 21, 2026

    @hyperpolymath
    OwnerAuthor

    Preview1 sockio lowering is on the branch: net_recv/net_send/net_accept → sock_recv/sock_send/sock_accept, Effect Net, stub tests + gated tests/componentize/sockio_smoke.sh.

    Landed on wasi-485-closeout (main...feat/wasi-485-closeout). Index #175 closed.

  2. added a commit that references this issue on Sep 21, 2026
  3. hyperpolymath commented on Sep 21, 2026

    @hyperpolymath
    OwnerAuthor

    PR opened: #757 (feat/wasi-485-closeout → main).

  4. hyperpolymath commented on Sep 21, 2026

    @hyperpolymath
    OwnerAuthor

    Landed in #757 (merged to main). net_recv/net_send/net_accept → sock_recv/sock_send/sock_accept, Effect Net, gated tests/componentize/sockio_smoke.sh.

    Closing this follow-up.

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

    enhancementNew capability or improvement to existing behaviour

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions