基于分帧 CBOR 的远程 pi 会话客户端Transport-neutral client for remote pi sessions over framed CBOR bytes
← → 翻页 · F 全屏 · O 目录 · T 明暗 · L 语言← → navigate · F fullscreen · O overview · T theme · L language
根入口不碰 Node API:浏览器或 worker 也可以用,只要提供自己的传输(例如 WebSocket)。The root entry touches no Node APIs: a browser or worker can use it with its own transport (a WebSocket, say).
旧尝试的回调带着旧 id,被 #isCurrent(id) 过滤掉;工厂迟到返回的传输会被直接 close()。Callbacks from an old attempt carry its id and are filtered by #isCurrent(id); a transport the factory returns late is simply closed.
回应可以乱序到达;没有对应条目的回应是协议错误,会断开连接。Responses may arrive out of order; a response with no matching entry is a protocol error and drops the connection.
createServiceStateDecoder()):快照和更新都经过它。Every subscription has its own Chord state decoder (createServiceStateDecoder()); snapshots and updates both go through it.dispose() 只在仍连接且路由仍是当前路由时发退订;随后等待 deliveryTail 并清空缓冲。dispose() sends the unsubscribe only while connected and while the route is current; then it awaits deliveryTail and clears the buffers.附着信封先于 attach 的回应送达:回应 resolve 时 client.attachment 已经可用。The attachment envelope arrives before the attach response: when it resolves, client.attachment is already set.
maxPendingBytes 默认是帧上限的 4 倍(64 MiB);超过就拒绝这次 send,Connection 随之断开。maxPendingBytes defaults to 4 × the frame limit (64 MiB); beyond it the send rejects and the Connection drops.
只读:陈旧或无响应的 socket 只会被忽略,从不删除——清理归服务器端的监听器。Read-only: stale or unresponsive sockets are just ignored, never deleted; cleanup belongs to the server's listener.
断开时挂起的请求在本地拒绝,但已被服务器接受的工作仍可能在远端完成。On disconnect pending requests reject locally, but work the server accepted may still complete remotely.
接入任何保序字节流:WebSocket、管道、测试替身。Plug in any order-preserving byte stream: a WebSocket, a pipe, a test double.
把路由交给 Chord 绑定,得到类型化的远程服务。Hand a route to a Chord binding to get typed remote services.
收集监听器异常,而不影响连接。Collect listener exceptions without affecting the connection.
帧上限与 Unix 传输的排队上限;两端配置一致。The frame limit and the Unix transport's queue limit; configure both peers alike.
列出某个目录里可以握手的本机服务器。List the local servers in a directory that complete a handshake.