You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b201bc
Browse filesBrowse the repository at this point in the historyBrowse files
|`tunnel.open`|`tunnelId`, `target` (`{kind: tcp, host, port}` / `{kind: unix, path}`) |`null`; `CONNECT_FAILED` on failure; `BUSY` while the session has 256 open tunnels|
129
144
|`tunnel.write`|`tunnelId`, `data`|`null`; `BUSY` when the peer stops reading |
130
145
|`tunnel.shutdownWrite`|`tunnelId`|`null`; queued data is sent, then the write side is shut down; replies keep arriving |
131
146
|`tunnel.close`|`tunnelId`|`null`; aborts both directions, queued data is discarded |
@@ -229,7 +244,18 @@ changes were lost and the client must rescan the watched tree.
229
244
## Event delivery and persistent sessions
230
245
231
246
`server.hello` returns `session` with `persistent`, `resumed`,
232
-
`nextResourceId` and `lastEventSeq`. The session keeps every event until the
247
+
`nextResourceId`, `lastEventSeq` and, for a persistent session,
248
+
`sessionToken`: 128 random bits, hex encoded, fixed for the whole session.
249
+
The first client of a persistent session is admitted whatever it presents;
250
+
every later `server.hello` must present that token as `sessionToken`. A
251
+
missing or different token fails with `INVALID_SESSION_TOKEN`, the server
252
+
closes that connection, and the attached client is not disturbed. The socket
253
+
already admits only the host account, so the token keeps other programs of
254
+
that account, or a second window reusing the key, from taking over the
255
+
session and its buffered output. Clients keep it in secret storage and never
256
+
log it; the server compares it in constant time.
257
+
258
+
The session keeps every event until the
233
259
client acknowledges it with `server.ack` (clients acknowledge periodically,
234
260
for example every 256 events), up to 8 MiB; beyond that the oldest kept
235
261
events are dropped. Written to a socket is not received: when a connection
@@ -262,13 +288,15 @@ list. Clients branch on these facts, never on `os` alone, and check
0 commit comments