Skip to content

No socket options after creation (setNoDelay, setKeepAlive) blocks Perry's node:net #34

Description

@proggeramlug

Perry's P1 migration (node:net on turnloop) cannot implement socket.setNoDelay(), setKeepAlive() or the other post-creation socket options: turnloop accepts nodelay only in ConnectOpts at creation, ListenOpts has no such field at all, and there is no API to change an option on a live handle.

Node exposes these as methods on a connected socket, and servers commonly call setNoDelay(true) per accepted connection, so an accepted turnloop socket cannot be configured at all today.

Expected: a typed, backend-neutral socket-option API on Loop, for example set_option(handle, SocketOption) with a small enum (NoDelay, KeepAlive { idle, interval, count }, ReuseAddr at bind time, Linger, RecvBufferSize, SendBufferSize, Ipv6Only, Broadcast, multicast joins for UDP), returning Unsupported per backend where the platform has no equivalent.

Also needed: options on accepted sockets (the listener's defaults should not be the only choice), and ListenOpts should carry the accepted-socket defaults it can apply cheaply.

Verification: per option, assert the change is visible through the OS (getsockopt), and that behaviour changes where observable (for example NoDelay on a small-write round trip). Native Linux/macOS/Windows; WASI 0.2/0.3 where wasi:sockets exposes the option, Unsupported otherwise; web Unsupported.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions