为什么openfire的用户在会话中不存在SESSION的情况下仍保持在线

2024-02-22

I'm developing an android app contains "Messaging" using OpenFire as an XMPP server and using Smack for android client. All functions works fine, but when a user is online(as you can see it's state in admin panel of openfire), and network connectivity disconnected suddenly, the session of it will be destroyed, but the user remains ONLINE in server! Thus, the packets not stores in server as an offline messages and will be sent to user even the user is offline and packets will be lost! I was tested an windows client (Spark), but when its connectivity losing, session in server will be destroyed and the user immediately turns to OFFLINE! What can I do to solve this problem? User1 is online but has no session


此行为可能是由名为的 XMPP 功能引入的流管理 https://xmpp.org/extensions/xep-0198.html.

简而言之,此功能允许短暂断开连接的客户端从中断处继续,而无需执行与正常连接相关的所有操作(这往往涉及大量资源)。

这对于网络连接不稳定的客户端或将应用程序置于后台时终止连接的设备(例如在移动电话上)非常有用。

Openfire 实现了这个功能。请注意,正如您所描述的,数据包不会“丢失”。相反,所有未处理的数据包都将被缓冲,并且当客户端“太晚”重新连接时(适用超时,我认为默认值为 3 分钟),这些数据包将被视为好像它们被发送到断开连接的客户端。设备。

如果需要,您可以通过将“stream.management.active”属性设置为“false”来禁用此功能(但对于典型设置,您不希望这样做,因为流管理功能有很好的用途)。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么openfire的用户在会话中不存在SESSION的情况下仍保持在线 的相关文章

随机推荐