From d9ce904ca152e8f59ca02fc62c3fdf27ebdebcbf Mon Sep 17 00:00:00 2001 From: piegames Date: Sun, 26 Mar 2023 18:44:15 +0200 Subject: [PATCH] WIP clarifications --- server-protocol.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server-protocol.md b/server-protocol.md index 7005fb7..3e26509 100644 --- a/server-protocol.md +++ b/server-protocol.md @@ -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 @@ -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