我正在开发GCM云连接服务器(XMPP)。我正在使用建议的Smack API 4.0.6库。
我应该如何实现org.jivesoftware.smack.ConnectionListener
void authenticated(XMPPConnection connection)
void connected(XMPPConnection connection)
void connectionClosed()
void connectionClosedOnError(Exception e)
void reconnectingIn(int seconds)
void reconnectionFailed(Exception e)
void reconnectionSuccessful()
我能找到的唯一例子只是注销消息。
什么是正确的重新连接方式"干净利落的"当我的服务器失去上游连接时?
答案 0 :(得分:1)
当Smack失去与XMPP服务器的连接时,Smack会自动尝试重新连接。
因此,您 NOT 需要实现所有这些方法,您可以覆盖其中一些方法以扩展其功能。