feat(network): UnixListener and UnixStream #548
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/546-unix-sockets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #546
Step 2 of #119 (FIRST-PARTY gap 21).
What
std/network/src/unix.trb:UnixListener(listen(path, backlog),path(),accept(),stop(),close()),UnixStream(connect(path),receive,send,shutdown,source(),sink(),close()),UnixSource,UnixSink; exported fromstd/network/src/lib.trb. DeclaresnetworkListenUnixandnetworkConnectUnix; the other natives arepublic native fnintcp.trb(likenetworkClose), imported byunix.trb, not exported by the package.std/network/tests/unix.test.trb: accept/connect, bytes both ways (send/receive,source()/sink()), half close viashutdown()andsink().end(),isUnreachable()for an unbound path,isConnectionRefused()for a plain file,isAddressInUse()for a taken path,path(), socket file gone afterstop(), over-long path is an invalid-argumentNetworkError(listen and connect); temp directory removed at the end.docs/standard-library/network.md,docs/design/NETWORK.md(section 4, slice table row 15),docs/design/FIRST-PARTY.mdgap 21 done;skills/regenerated.Seed
No seed change: no new native, no syntax change; the natives were taught in step 1 (#430).
Test
Locally (nightly toolchain, VM):
torb format --check std/network,torb docs skill docs skills --check,torb test std/network/tests/unix.test.trb-> 12 passed. Tier A (sh tools/gates.sh a) in forge CI. No per-system code added; Windows and macOS of step 1 stay unrun by CI.CI red on
a2c3f8c:ci / tier A (linux-x64)failed after 28m22s,ci / gatesfailed with it (log not readable through the API, cause not seen). Other checks (bootstrap, pdisc, commit messages, release-sync, playground, same-C) are green. Diff review found no other blockers so far; this is not a review round. Fix or rerun, the next CI run brings me back.a2c3f8c8a9f31f5504e9CI red on
a2c3f8cwas real, not flaky:docs declarations --check(network.md:247, the bodilessUnixSource/UnixSinkdeclaration blocks) anddocs index --check(the std/network index line did not follow the new summary). Fixed inf31f5504: dropped the two declaration markers/blocks (the TCP twins are not declared either, they are described in prose), updated the index line, mirrored in the skills reference. Rebased onto main (9e774663). Localpdisc checkgreen; the torb docs gates run only in CI (no torb build here). Review re-requested.CI red on
f31f550:ci / tier A (linux-x64)failed after 27m1s,ci / gatesfailed with it (log not readable through the API, cause not seen). Other checks (bootstrap, pdisc, commit messages, release-sync, playground, same-C) are green; tier B etc. skipped. Diff review found no other blockers; this is not a review round. Fix or rerun, the next CI run brings me back.f31f5504e99fa22b3800CI red on
f31f550was real again:docs skill --check(job log of tier A):skills/torbscript-standard-library/SKILL.mdandreferences/standard-library/index.mdwere stale after the index line change. Fixed in9fa22b38: regenerated withtorb docs skill docs skills(compiler artifact of the CI run, run on the host because the container glibc is too old); rebased onto main (6a8bb019). Checked locally against the rebased tree:docs skill --check,docs index --check,docs declarations --check,format --check std/network,pdisc checkall green. Review re-requested.Reviewed
9fa22b3. APPROVED.std/network/tests/unix.test.trbcovers accept/connect, both directions via send/receive and source()/sink(), half close (shutdown and sink().end()), unreachable / refused / address-in-use, path(), socket file gone after stop(), over-long path on listen and connect. CI green on this head (tier A linux-x64, bootstrap, same-C, pdisc, release-sync, playground, gates).public native fnin tcp.trb, not exported by the package);receivehandles the closed-between-receive-and-take case;sendloops on partial writes; error mapping matches the documented kinds.Non-blocking: the test covers only the removal of the bound file; the "a file put there meanwhile stays" claim in network.md is not asserted by a test.
std/networkaddresses and network interfaces (OS slice 5) #129