Skip to content

Commit d9ce904

Browse files
committed
WIP clarifications
1 parent c6569d7 commit d9ce904

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

server-protocol.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ coming from the other client.
234234
Each mailbox is "opened" by some number of clients at a time, until all
235235
clients have closed it. Mailboxes are kept alive by either an open client, or
236236
a Nameplate which points to the mailbox (so when a Nameplate is deleted from
237-
inactivity, the corresponding Mailbox will be too).
237+
inactivity, the corresponding Mailbox will be too). The mailbox server makes
238+
sure a mailbox can never be opened by more than two parties, neither
239+
simultaneously not cumulatively. Trying to open a mailbox as a third party
240+
results in a "crowded" error for that attempt.
238241

239242
The `open` command both marks the mailbox as being opened by the bound side,
240243
and also adds the WebSocket as subscribed to that mailbox, so new messages
@@ -292,7 +295,9 @@ continue to send messages (so-called "half-closed state") until sending a `close
292295
message too, which in turn will send the `closed` command to the first client and
293296
thus finalize the session teardown. The second client may disconnect directly
294297
after sending the `close` message, there will be no further confirmation. It is
295-
an error to send messages after having sent `close`.
298+
an error to send messages after having sent `close`. If a client closes the
299+
mailbox before the other side opens it, the second client will get a "closed"
300+
error message while trying to open the mailbox.
296301

297302
## All Message Types
298303

0 commit comments

Comments
 (0)