3

我正在使用 Diffusion v5.6.6 创建一个移动应用程序,当客户端失去移动连接然后再次获得连接时,应用程序恢复非常重要。我可以在 Connectors.xml 中看到与此相关的两个设置:

<!-- This is the idle time (no inbound messages) before a
     client will be pinged by the server. A response must
     be received by Diffusion before the next interval,
     else the client is considered to be disconnected. -->
<system-ping-frequency>90s</system-ping-frequency>

<reconnect>
   <!-- This is the amount of milliseconds a session
        will be kept alive after a sudden connection loss. -->
   <keep-alive>60000</keep-alive>
</reconnect>

这个 90 秒的 ping 和 60 秒的保活有什么区别?

4

1 回答 1

1

扩散手册的相关页面

关于 60 秒保活;当客户端失去连接时,它会进入重新连接状态,会话在服务器上持续存在,直到客户端重新连接或达到保持活动时间并且会话被销毁。客户端的消息在重新连接状态时仍然排队。

关于 90 秒 ping;system-ping-frequency指定服务器 ping 客户端的频率。这用于检测客户端已断开连接,并且如果在另一个间隔期到期之前未从客户端接收到响应,则假定客户端已断开连接。如果该值设置为 0,则不会 ping 客户端。

于 2016-04-06T21:39:06.613 回答