如何在使用中央服务器进行操作转换的系统中与多个客户端进行实时协作?

发布于 2024-08-30 07:15:32 字数 521 浏览 9 评论 0原文

我刚刚读完 Jupiter 中的高延迟、低带宽窗口协作系统 和我基本上遵循了所有内容,直到第 6 部分:全局一致性。这部分描述了如何扩展本文中描述的系统以适应连接到服务器的多个客户端。然而,解释非常简短,本质上是说如果中央服务器仅将客户端消息转发给所有其他客户端,则系统将正常工作。我真的不明白这是如何运作的。在发送给所有其他客户端的消息中将发送什么状态向量?服务器是否为每个客户端维护单独的状态向量?它是否在本地为每个客户端维护一个单独的小部件副本?

我能想到的简单例子是这样的设置:想象客户端 A、服务器和客户端 B,其中客户端 A 和客户端 B 都连接到服务器。首先,这三个对象都有状态对象“ABCD”。然后,客户端A向服务器发送“在位置0处插入字符F”消息,同时客户端B向服务器发送“在位置0处插入字符G”消息。看起来简单地将客户端 A 的消息转发给客户端 B(反之亦然)实际上并不能处理这种情况。那么服务器具体是做什么的呢?

I just finished reading High-Latency, Low-Bandwidth Windowing in the Jupiter Collaboration System and I mostly followed everything until part 6: global consistency. This part describes how the system described in the paper can be extended to accomodate for multiple clients connected to the server. However, the explanation is very short and essentially says the system will work if the central server merely forwards client messages to all the other clients. I don't really understand how this works though. What state vector would be sent in the message that is sent to all the other clients? Does the server maintain separate state vectors for each client? Does it maintain a separate copy of the widgets locally for each client?

The simple example I can think of is this setup: imagine client A, server, and client B with client A and client B both connected to the server. To start, all three have the state object "ABCD". Then, client A sends the message "insert character F at position 0" at the same time client B sends the message "insert character G at position 0" to the server. It seems like simply relaying client A's message to client B and vice versa doesn't actually handle this case. So what exactly does the server do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里人 2024-09-06 07:15:32

我实际上已经知道这是如何运作的了。在我的示例中,服务器为客户端 A 和客户端 B 保留一个状态空间。在服务器首先获取客户端 A 的消息的情况下,服务器获取带有状态向量 (0, 0) 的消息,插入 F,然后更新其状态向量对于 A 和 B 分别为 (1, 0) 和 (0, 1)(其中第一个数字是已处理的来自客户端的消息数,第二个数字是已处理的来自服务器的消息数)已处理)。然后,服务器发送带有状态向量 (0, 0) 的“在位置 0 处插入 F”(因为这是服务器收到消息时 B 的状态空间中服务器的状态),并获得“在位置 0 处插入 G”从 B 以状态 (0, 0) 发送。由于服务器在 B 的状态空间中处于 (0, 1) 状态,因此它首先转换消息(同样,由于 B 在接收到服务器的消息时处于 (1, 0) 状态,因此它也会转换从服务器获取的消息服务器)。因为必须设置转换,以便如果 xform(c, s) = (c', s') 则应用于 s 的 c' 等于应用于 c、B 的 s',并且服务器最终处于相同的状态。服务器从 B 接收然后发送给 A 的消息也会发生同样的情况。

I actually figured out how this would work. In my example, server keeps a state space for both client A and client B. In the case where server gets client A's message first, the server gets the message with state vector (0, 0), inserts F, then updates its state vectors to be (1, 0) and (0, 1) for A and B, respectively (where the first number is the number of messages from the client that have been processed and the second is the number of messages from the server that have been processed). The server then sends "insert F at position 0" with state vector (0, 0) (since this was the state of the server in B's state space when the message was received by the server) and gets "insert G at position 0" from B sent with state (0, 0). Since the server is in state (0, 1) in B's state space, it first transforms the message (and similarly, since B is in (1, 0) when it receives the server's message, it also transforms the message it got from the server). Because transformations must be setup so that if xform(c, s) = (c', s') then c' applied to s equals s' applied to c, B and the server end up in the same state. The same happens with the message the server received from B and then sends to A.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文