我在 smack library v4.1.5 (Android) 和 openfire v4.0.1 中发现了一个关于 XMPP 重新连接过程的非常大的问题(可能是我的?)。我以这种方式在客户端激活了流管理:
XMPPTCPConnection.setUseStreamManagementDefault(true);
XMPPTCPConnection.setUseStreamManagementResumptionDefault(true);
并以这种方式激活自动重新连接:
ReconnectionManager.getInstanceFor(this.xmppConnection).enableAutomaticReconnection();
第一次成功连接并登录后,当互联网连接断开并且重新连接过程开始时,我收到以下错误:
W/AbstractXMPPConnection: Connection closed with error
org.jivesoftware.smack.XMPPException$StreamErrorException: conflict You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
<stream:error><conflict xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1003)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:944)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:959)
重新连接管理器连接和身份验证非常好,但是我收到了之前的错误!我也尝试更改资源,但没有任何效果,它不起作用!有人可以帮助我理解什么是错的?