注册

集成环信后,APP在后台时间长了之后回来,偶尔会发不出消息,好像提示socket错误,而且也收不到了消息。

好像连接环信服务器不稳定?还是其他问题?  环信又没有手动连接服务器的api?

报错的log
11-12 13:46:53.320 25741-27911/cn.haishangxian.anshang W/System.err: java.lang.IllegalStateException: Not connected to server.
11-12 13:46:53.320 25741-27911/cn.haishangxian.anshang W/System.err:     at org.jivesoftware.smack.XMPPConnection.sendPacket(Unknown Source)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at org.jivesoftware.smack.ChatManager.sendMessage(Unknown Source)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at org.jivesoftware.smack.Chat.sendMessage(Unknown Source)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at com.easemob.chat.EMSendMessageRunnable.sendMessageXmpp(Unknown Source)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at com.easemob.chat.EMSendMessageRunnable.run(Unknown Source)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
11-12 13:46:53.330 25741-27911/cn.haishangxian.anshang W/System.err:     at java.lang.Thread.run(Thread.java:856)
已邀请:
用最新版的Demo做测试,看看是否有这个情况,如果不是极少型号的定制机,app在后台是不会杀死进程和服务的。

要回复问题请先登录注册