How to use stream management acks in xmpp.js (in react-native) with MongooseIM (as chat server)?

穿精又带淫゛_ 提交于 2019-12-13 18:31:56

问题


I am using xmpp.js as xmpp chat client inside react-native for both android+ios with MongooseIM as chat server. I want to implement stream management acks in the App. But according to the issue#540, xmpp.js doesn't officially support stream management for now. What can be the alternate to this?

I need the stream management module only to send/receive acks between c2s and s2s. Please guide.


回答1:


Stream Management, if not available in your client library of choice, is somewhat complex to implement - though definitely would be welcome by the open source community ;)

XMPP Ping is a simpler alternative to detect broken connections. It's available in a range of servers including MongooseIM and ejabberd. The idea is that any side of the connection sends a ping IQ - since IQs are standardised to require responses, if a response does not come in a predefined time interval, you can assume such a connection is dead. There's no protocol for message retransmission like with Stream Management, but if you're running with Message Archive Management (mod_mam) all the messages should be stored safely anyway.

Alternatively, as somebody has suggested in the issue you link, you could switch to Stanza.io which supports XEP-198.



来源:https://stackoverflow.com/questions/53257285/how-to-use-stream-management-acks-in-xmpp-js-in-react-native-with-mongooseim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!