的Android啪Ejabberd多个连接问题

问题描述:

使用Ejabbered &嫌Android客户端IM上delveloping聊天应用程序,每次用户进入应用程序,我会把我的存在可用服务器&每次用户离开应用程序,我要送的存在为不可用,所以我可以接收之后发送的离线消息。但是,虽然我在离开应用程序时发送了存在数据包,但当我从不同的客户端进行检查时,仍然可以看到用户在线。看着logcat的,我怀疑多连接还活着:的Android啪Ejabberd多个连接问题

已注销:

--------------------------------- 
06-22 12:36:42.473 2985-3052/ask.around D/SMACK: SENT (0): <presence id='R0C81-14' type='unavailable'><priority>1</priority><show>away</show></presence><r xmlns='urn:xmpp:sm:3'/> 
06-22 12:36:42.474 2985-3052/ask.around D/SMACK: SENT (0): <presence id='R0C81-15' type='unavailable'></presence> 
06-22 12:36:42.475 2985-3052/ask.around D/SMACK: SENT (0): <a xmlns='urn:xmpp:sm:3' h='5'/> 
06-22 12:36:42.486 2985-3052/ask.around D/SMACK: SENT (0): 
06-22 12:36:42.487 2985-3052/ask.around D/SMACK: SENT (0): </stream:stream> 
06-22 12:36:42.616 2985-3053/ask.around D/SMACK: RECV (0): <a h='5' xmlns='urn:xmpp:sm:3'/> 
06-22 12:36:42.692 2985-3053/ask.around D/SMACK: RECV (0): </stream:stream> 
06-22 12:36:42.693 2985-3271/ask.around D/SMACK: XMPPConnection closed (XMPPTCPConnection[[email protected]/48305568695274620153122] (0)) 

没有登出:

06-22 12:02:01.952 2586-3299/ask.around D/SMACK: SENT (2): <presence id='86IU1-48' type='unavailable'><priority>1</priority><show>away</show></presence><r xmlns='urn:xmpp:sm:3'/><presence id='86IU1-49' type='unavailable'></presence><a xmlns='urn:xmpp:sm:3' h='6'/> 
06-22 12:02:01.952 2586-3299/ask.around D/SMACK: SENT (2): </stream:stream> 
06-22 12:02:02.032 2586-3300/ask.around D/SMACK: RECV (2): <a h='5' xmlns='urn:xmpp:sm:3'/> 
06-22 12:02:02.052 2586-3282/ask.around D/SMACK: RECV (1): <presence xml:lang='en' to='[email protected]/104236288900606474493066' from='[email protected]/105858598794378801093074' type='unavailable' id='86IU1-48'><priority>1</priority><show>away</show></presence><r xmlns='urn:xmpp:sm:3'/> 
06-22 12:02:02.053 2586-3281/ask.around D/SMACK: SENT (1): <a xmlns='urn:xmpp:sm:3' h='7'/> 
06-22 12:02:02.099 2586-3300/ask.around D/SMACK: RECV (2): </stream:stream> 
06-22 12:02:02.100 2586-2938/ask.around D/SMACK: XMPPConnection closed (XMPPTCPConnection[[email protected]/105858598794378801093074] (2)) 

是什么我做了错误,我的成功logcat的发现注销数字总是零,n在不成功的一个它最多2,所以我创建多个连接?或者数字不是连接的否?如果它是连接数量的问题如何创建一个n唯一的实例,直到我的应用程序还活着?

在进行连接之前,您可以大声说出旧实例这可能对您有所帮助。

if(mXmpptcpConnection!=null){ 
     mXmpptcpConnection.instantShutdown(); 
    }