我发现了一个关于smack库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)
重新连接管理器连接并验证非常好,但后来我收到了上一个错误! 我试图改变资源,但没有,它不起作用! 有人可以帮我理解错误吗?