Commit f1563f5
feat: raw-TCP socket transport (serveTcp / tcpConnect / TransportKind.TCP)
Add a TCP (AF_INET) transport that speaks the raw Arrow-IPC framing
protocol — the network analog of the existing AF_UNIX runner, for
trusted-network co-located workers that want the lean framing without the
HTTP envelope. Mirrors the Python reference (vgi-rpc 8ea49aa).
- src/launcher/serve-tcp.ts: serveTcp(protocol, { host, port, ... }) binds
(host, port), defaults host to 127.0.0.1 (loopback only), port 0 lets the
OS auto-select, disables Nagle (setNoDelay) per connection, and emits a
TCP:<host>:<port> discovery line once bound (after which no more stdout).
Same per-connection IPC dispatch loop and idle-timeout model as serveUnix.
- src/client/tcp.ts: tcpConnect(host, port) client helper wrapping pipeConnect
over a connected TCP socket. Node-only (statically imports node:net), so it
is exported only from the node barrel, never from the runtime-agnostic core
that browser/workerd bundles re-export.
- TransportKind.TCP; serveTcp reports it via the ServeStartHook / DispatchInfo.
- examples/conformance.ts: --tcp [HOST:]PORT (loopback-default host), prints
TCP:<host>:<port> — mirrors the --unix / UNIX:<path> launcher contract.
- Focused round-trip tests (test/tcp.test.ts) and rebuilt dist.
Raw TCP carries NO authentication or TLS; it is for trusted networks only and
defaults to loopback (127.0.0.1). Use the HTTP transport for untrusted networks.
Verified cross-language: TS --tcp worker against `vgi-rpc-test --tcp` passes
102 total / 98 passed / 0 failed / 4 skipped — exact parity with the pipe run.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0d49a69 commit f1563f5
26 files changed
Lines changed: 2237 additions & 1282 deletions
File tree
- dist
- client
- launcher
- examples
- src
- client
- launcher
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | | - | |
| 3 | + | |
3 | 4 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments