Repository navigation
Description
Summary
Node's net.Socket exposes a sizeable property surface for connection state, endpoint metadata, and byte counters. Perry currently implements core socket methods and socket.address(), but the committed net.Socket path does not expose the corresponding properties.
Missing/unwired examples from the current parity inventory include:
socket.autoSelectFamilyAttemptedAddressessocket.bufferSizesocket.bytesReadsocket.bytesWrittensocket.connectingsocket.destroyedsocket.localAddress,socket.localPort,socket.localFamilysocket.pendingsocket.remoteAddress,socket.remotePort,socket.remoteFamilysocket.readyStatesocket.timeout
Evidence
- Current Node docs list these properties under
net.Socket: https://nodejs.org/api/net.html#class-netsocket docs/runtime-parity.md:879-893lists the socket metadata/counter/state property rows.docs/runtime-parity-gaps.md:1163-1170still retains the same property set in thenode:netgap list.test-files/test_parity_net.ts:114-128only probes these properties on a newly allocatednet.Socket.crates/perry-ext-net/src/lib.rs:231-244definesSocketStatewithcmd_tx,pending_rx,is_open,local_addr, and raw bridge state, but no byte counters, remote address cache, timeout value, ready-state enum, or auto-select attempted address list.crates/perry-ext-net/src/lib.rs:671-684and:1197-1205allocateSocketStatewithout those fields.crates/perry-codegen/src/lower_call/native_table/net_events.rs:253-419wires methods such aswrite,end,destroy, option setters, andsocket.address(), but has no getter rows for the socket properties above.crates/perry-api-manifest/src/entries.rs:547-590likewise registers socket methods only; no property getter entries exist for these metadata/counter/state properties.
Expected behavior
A Node-compatible socket should expose stable property reads before, during, and after connection lifecycle transitions. For example:
const net = require('node:net');
const socket = new net.Socket();
console.log(socket.pending); // true before connect
console.log(socket.connecting); // false before connect
console.log(socket.destroyed); // false before destroy
console.log(socket.bytesRead); // 0 initially
console.log(socket.bytesWritten); // 0 initially
console.log(socket.readyState); // Node-shaped state string
console.log(socket.timeout); // timeout value or undefinedAfter connection, local* and remote* properties should reflect the socket endpoints, byte counters should update with reads/writes, readyState/pending/connecting/destroyed should track lifecycle transitions, and autoSelectFamilyAttemptedAddresses should report Happy Eyeballs attempts when relevant.
Duplicate check
I searched issues and PRs for net.Socket remoteAddress bytesRead readyState socket properties, net.Socket bytesRead bytesWritten remoteAddress, and related socket metadata terms. Existing closed net lifecycle issues (#1852/#2131) covered connection hangs, socket.address(), EventEmitter wiring, and callback ordering. Open #2522 covers module-level auto-select-family defaults, and #2548 covers TOS methods. I did not find an open tracker for this net.Socket property surface.
I could not run a fresh local Perry reproduction in this checkout because no built perry binary is present; this is based on committed source, parity metadata, current Node docs, and issue/PR search.
Activity
andrewtdiz commentedon May 30, 2026
Related object-surface leaf: #3397 covers
net.Socketmethod property reads returning non-callable numeric/native values instead of functions. It is a same-PR candidate if the socket metadata/counter work is already touching Socket property dispatch, but should remain separate from endpoint state/counter semantics.