Skip to content

Commit

Permalink
WIP clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
piegamesde committed Mar 26, 2023
1 parent c6569d7 commit d9ce904
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ coming from the other client.
Each mailbox is "opened" by some number of clients at a time, until all
clients have closed it. Mailboxes are kept alive by either an open client, or
a Nameplate which points to the mailbox (so when a Nameplate is deleted from
inactivity, the corresponding Mailbox will be too).
inactivity, the corresponding Mailbox will be too). The mailbox server makes
sure a mailbox can never be opened by more than two parties, neither
simultaneously not cumulatively. Trying to open a mailbox as a third party
results in a "crowded" error for that attempt.

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

## All Message Types

Expand Down

0 comments on commit d9ce904

Please sign in to comment.