为了账号安全,请及时绑定邮箱和手机立即绑定

网络改变后还是不能自动重连...

关闭WiFi的时候,报错误:

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): XMPP connection failed

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): 192.168.3.100:5222 Exception: XMPPError connecting to 192.168.3.100:5222.; : remote-server-error(502)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512):   -- caused by: XMPPError connecting to 192.168.3.100:5222.: remote-server-error(502) XMPPError connecting to 192.168.3.100:5222.

01-21 09:34:23.872: E/Androidpn_XmppManager(1512):   -- caused by: java.net.ConnectException: failed to connect to /192.168.3.100 (port 5222): connect failed: ENETUNREACH (Network is unreachable)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:601)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1021)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.androidpn.client.XmppManager$ConnectTask.run(XmppManager.java:307)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.FutureTask.run(FutureTask.java:137)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.lang.Thread.run(Thread.java:856)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): Nested Exception: 

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): XMPPError connecting to 192.168.3.100:5222.: remote-server-error(502) XMPPError connecting to 192.168.3.100:5222.

01-21 09:34:23.872: E/Androidpn_XmppManager(1512):   -- caused by: java.net.ConnectException: failed to connect to /192.168.3.100 (port 5222): connect failed: ENETUNREACH (Network is unreachable)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:574)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1021)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at org.androidpn.client.XmppManager$ConnectTask.run(XmppManager.java:307)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)

01-21 09:34:23.872: E/Androidpn_XmppManager(1512): at java.util.concurrent.FutureTask.run(FutureTask.java:137)   等...

接着我重新连上WiFi后,log先打印:

01-21 09:34:34.696: I/Androidpn_ConnectivityReceiver(1512): Network connected

然后就一直重复打印下面的log:

01-21 09:34:34.696: D/Androidpn_NotificationService(1512): connect()...

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): connect()...

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): submitLoginTask()...

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): submitRegisterTask()...

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): submitConnectTask()...

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)...

01-21 09:34:34.696: D/Androidpn_NotificationService(1512): Incremented task count to 9

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)... done

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)...

01-21 09:34:34.696: D/Androidpn_NotificationService(1512): Incremented task count to 10

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)... done

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)...

01-21 09:34:34.696: D/Androidpn_NotificationService(1512): Incremented task count to 11

01-21 09:34:34.696: D/Androidpn_XmppManager(1512): addTask(runnable)... done

01-21 09:34:43.864: D/Androidpn_XmppManager(1512): connect()...

问题出在哪里呢?

正在回答

3 回答

你的单队列执行出问题了,视频的6-6节就演示了这个问题,解决方法还没有更新出来,我也没想到这一期视频被分成了三期来放的,你要看到解决方法的话可能要等到下周了。

0 回复 有任何疑惑可以回复我~
#1

sanmu083 提问者

非常感谢!
2015-01-21 回复 有任何疑惑可以回复我~

这个问题怎么解决呢?


0 回复 有任何疑惑可以回复我~

谢谢郭大侠的回答,我也意识到了是这个问题,但实在是无从下手,菜鸟对源码一直都有莫名的恐惧,希望郭大侠能快点更新。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
见证Android消息推送时刻
  • 参与学习       48192    人
  • 解答问题       203    个

本课程将一步步教你如何搭建出一个自己的Android推送平台

进入课程

网络改变后还是不能自动重连...

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信