Why the openfire's user remains ONLINE even with no SESSION exists in sessions

前端 未结 2 1026
孤独总比滥情好
孤独总比滥情好 2021-01-13 08:54

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 onlin

相关标签:
2条回答
  • 2021-01-13 09:12

    This is a bug with keepalive mechanism. Please check this:

    https://issues.igniterealtime.org/browse/OF-963

    I am having same issue with version 4.2.3. Switched back to 4.0.2. Issue is reported for version 4.0.3.

    0 讨论(0)
  • 2021-01-13 09:25

    This behavior is likely introduced by an XMPP feature called Stream Management.

    In short, this feature allows for clients that briefly disconnect to pick up where they left off, without doing all of the things associated with a normal connect (which tends to involve a lot of resources).

    This is useful for clients with spotty network connectivity, or devices that kill connections when putting an application to the background, like on mobile phones.

    Openfire implements this functionality. Note that packets are not 'lost', as you describe. Instead, all of the unhandled packets will be buffered, and, when the client is 'to late' to reconnect (a timeout applies, I think the default is 3 minutes), those packets will be treated as if they were sent to a disconnected device.

    If you want, you can disable this feature by setting the 'stream.management.active' property to 'false' (but for typical setups, you don't want this, as the Stream Management functionality serves a good purpose).

    0 讨论(0)
提交回复
热议问题