Repository navigation
Description
Summary
node:net Socket and Server instances should expose function-valued methods when user code reads method properties. Perry can route some direct method calls, but method-value reads currently return numeric/native handles or otherwise non-callable values, so feature detection and aliased method calls do not match Node.
Node Behavior
test-files/test_parity_net.ts constructs new net.Server() and new net.Socket() and probes method property values without opening a live network connection:
const s = new net.Server();
console.log("server.address() before listen:", s.address());
console.log("server.close typeof:", typeof s.close);
console.log("server.getConnections typeof:", typeof s.getConnections);
console.log("server.listen typeof:", typeof s.listen);
console.log("server.ref typeof:", typeof s.ref);
console.log("server.unref typeof:", typeof s.unref);
const sock = new net.Socket();
console.log("socket.address typeof:", typeof sock.address);
console.log("socket.connect typeof:", typeof sock.connect);
console.log("socket.destroy typeof:", typeof sock.destroy);
console.log("socket.end typeof:", typeof sock.end);
console.log("socket.write typeof:", typeof sock.write);Node output from ./run_parity_tests.sh --filter test_parity_net includes:
server.address() before listen: null
server.close typeof: function
server.getConnections typeof: function
server.listen typeof: function
server.ref typeof: function
server.unref typeof: function
socket.address typeof: function
socket.connect typeof: function
socket.destroy typeof: function
socket.destroySoon typeof: function
socket.end typeof: function
socket.pause typeof: function
socket.ref typeof: function
socket.resetAndDestroy typeof: function
socket.resume typeof: function
socket.setEncoding typeof: function
socket.setKeepAlive typeof: function
socket.setNoDelay typeof: function
socket.setTimeout typeof: function
socket.unref typeof: function
socket.write typeof: function
Perry Behavior
The same run shows non-callable values for these object methods:
class net.Server typeof: function
new net.Server typeof: object
Server error: address is not a function
class net.Socket typeof: function
new net.Socket typeof: object
socket.address typeof: number
socket.connect typeof: number
socket.destroy typeof: number
socket.destroySoon typeof: number
socket.end typeof: number
socket.pause typeof: number
socket.ref typeof: number
socket.resetAndDestroy typeof: number
socket.resume typeof: number
socket.setEncoding typeof: number
socket.setKeepAlive typeof: number
socket.setNoDelay typeof: number
socket.setTimeout typeof: number
socket.unref typeof: number
socket.write typeof: number
The focused net validation node-suite currently passes 4/4, so this is not about invalid input validation. The other broad test_parity_net mismatches map to existing leaves for BlockList / SocketAddress, server connection-count/limit state, socket TOS methods, and socket metadata/counter properties.
Suggested PR Cut
Batch this with related issues in:
node:net: Socket and Server object surface parity cut
Good batch candidates:
- node:net: implement Server connection count and max-connection limit surface #2546
- node:net: implement Socket Type of Service APIs #2548
- node:net: expose Socket state, address, and byte-counter properties #2549
Do not batch with:
- unrelated modules
- broad subsystem rewrites
- fixes needing different test harnesses
BlockList/SocketAddressclasses in node:net: implement BlockList and SocketAddress classes #2508- IPv6 zone-id parsing in node:net: accept IPv6 zone identifiers in isIP helpers #3037
- auto-select-family setter validation in node:net: validate auto-select-family default setters #3038
- CI-only fixture/environment work in Parity CI: environment-only failures (server fixtures, npm install, runner-specific) #1634
Acceptance
- parity/regression test proves reading
net.Serverandnet.Socketmethods returns callable functions for covered methods - aliased calls such as
const write = socket.write;either behave like Node for covered cases or fail with Node-compatible receiver errors when called incorrectly - existing direct-call socket/server behavior and net validation fixtures remain passing
- related known-failure/docs/manifest entries updated if touched
Duplicate checks
Searched issues/PRs for:
net.Socket method values typeof number function address connect destroy writenode:net Socket method-value reads non-callable number functionnative method-value reads typeof number function net.Socketmethod-value reads typeof function number native methodvalue is not a function native method reads typeof number- PR search
net.Socket method values typeof number function address connect destroy write
I found existing open net leaves for class data structures, Server connection-limit state, socket TOS methods, socket state/address/counter properties, Stream alias, IPv6 zone IDs, and auto-select-family validation, but no open precise issue for Socket / Server method property reads returning non-callable values.
Activity
andrewtdiz commentedon May 31, 2026
I’m taking this one in a focused PR cut for net Socket/Server method-value reads. Scope: make covered Server and Socket method property reads callable and add parity coverage for direct method reads/aliased values without broad live socket behavior changes.
andrewtdiz commentedon May 31, 2026
Opened PR: #3519
Verification:
PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module netfailed 1/6 at the new method-value fixture.PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module netpassed 6/6.cargo fmt --all -- --check,./scripts/check_file_size.sh,jq empty test-parity/known_failures.json, andgit diff --check HEAD~1..HEADall passed.