注册

android sdk总是掉线

10-15 11:52:29.602 27267-11368/com.remair.borrowme I/sxmppcon: enter disconnect (176453626)
10-15 11:52:29.762 27267-11368/com.remair.borrowme I/sxmppcon: shutdown was called
10-15 11:52:29.762 27267-11368/com.remair.borrowme W/System.err: com.easemob.exceptions.EMNetworkUnconnectedException: java.net.ConnectException: failed to connect to im1.easemob.com/182.92.23.59 (port 443) after 40000ms: isConnected failed: ECONNREFUSED (Connection refused)
10-15 11:52:29.762 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connect(Unknown Source)
10-15 11:52:29.762 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connectSync(Unknown Source)
10-15 11:52:29.762 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.reconnectSync(Unknown Source)
10-15 11:52:29.762 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager$3.run(Unknown Source)
10-15 11:52:38.852 27267-11368/com.remair.borrowme I/sxmppcon: enter disconnect (176453626)
10-15 11:52:39.012 27267-11368/com.remair.borrowme I/sxmppcon: shutdown was called
10-15 11:52:39.022 27267-11368/com.remair.borrowme W/System.err: com.easemob.exceptions.EMNetworkUnconnectedException: java.net.ConnectException: failed to connect to im1.easemob.com/182.92.20.117 (port 443) after 40000ms: isConnected failed: ECONNREFUSED (Connection refused)
10-15 11:52:39.022 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connect(Unknown Source)
10-15 11:52:39.022 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connectSync(Unknown Source)
10-15 11:52:39.022 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.reconnectSync(Unknown Source)
10-15 11:52:39.022 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager$3.run(Unknown Source)
10-15 11:52:45.082 27267-11368/com.remair.borrowme I/sxmppcon: enter disconnect (176453626)
10-15 11:52:45.242 27267-11368/com.remair.borrowme I/sxmppcon: shutdown was called
10-15 11:52:45.242 27267-11368/com.remair.borrowme W/System.err: com.easemob.exceptions.EMNetworkUnconnectedException: java.net.ConnectException: failed to connect to im1.easemob.com/182.92.23.59 (port 5222) after 40000ms: isConnected failed: ECONNREFUSED (Connection refused)
10-15 11:52:45.242 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connect(Unknown Source)
10-15 11:52:45.242 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.connectSync(Unknown Source)
10-15 11:52:45.242 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager.reconnectSync(Unknown Source)
10-15 11:52:45.242 27267-11368/com.remair.borrowme W/System.err:     at com.easemob.chat.core.EMConnectionManager$3.run(Unknown Source)
周期性的输出这个,25秒一次
已邀请:
换个网络试试
我这也出现了,不知道是不是环信服务器出问题了,但是IOS版的又能登录。
从报错log上并不能看也导致掉线的原因是什么,导致掉线的原因也不是固定只有一种,你们测试的是自己的app还是Demo,如果demo没问题,可能你的代码处理逻辑有关,还有你集成的SDK版本是多少? 这个需要诊断定位来排查的,如果更详细的沟通这个问题,也可联系我们的客服,或者在官网下方寻求一下在线技术支持。
今天抓了下日志,发现只要服务器没有应道心跳包,就收不到消息,并且关掉当前socket,开启新的socket后,服务器马上有应答,这说明不是网络的问题。另外官方demo也存在这样的问题。想到的解决办法就是app收不到消息的时候强行调用环信的登陆。如果有跟好的解决办法,欢迎讨论。附上日志:
12-08 17:43:52.974: D/EMHeartBeatReceiver(23769): onReceive EMHeartBeatReceiver
12-08 17:43:52.989: D/smart ping(23769): post heartbeat runnable
12-08 17:43:52.994: D/net(23769): has wifi connection
12-08 17:43:52.999: D/smart ping(23769): has network connection:true has data conn:true isConnected to easemob server : true
12-08 17:43:52.999: D/net(23769): has wifi connection
12-08 17:43:52.999: D/smart ping(23769): check pingpong ...
12-08 17:43:53.999: D/smart ping(23769): send ping-pong type heartbeat
12-08 17:43:54.009: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-5" type="get"><ping xmlns='urn:xmpp:ping' /></iq>
12-08 17:44:09.009: D/smart ping(23769): no result while send ping-pong
12-08 17:44:10.019: D/smart ping(23769): send ping-pong type heartbeat
12-08 17:44:10.019: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-5" type="get"><ping xmlns='urn:xmpp:ping' /></iq>
12-08 17:44:25.024: D/smart ping(23769): no result while send ping-pong
12-08 17:44:26.034: D/smart ping(23769): send ping-pong type heartbeat
12-08 17:44:26.044: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-5" type="get"><ping xmlns='urn:xmpp:ping' /></iq>
12-08 17:44:41.044: D/smart ping(23769): no result while send ping-pong
12-08 17:44:42.054: D/smart ping(23769): send ping-pong type heartbeat
12-08 17:44:42.064: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-5" type="get"><ping xmlns='urn:xmpp:ping' /></iq>
12-08 17:44:57.064: D/smart ping(23769): no result while send ping-pong
12-08 17:44:57.084: D/smart ping(23769): failed to send ping pong ... with current heartbeat interval : 03:30:000
12-08 17:44:57.094: D/net(23769): has wifi connection
12-08 17:44:57.099: D/smart ping(23769): send ping-pong failed, but has success interval candiate with ping state : EMEvaluating enter EMSmartPingState.EMReevaluating
12-08 17:44:57.104: D/smart ping(23769): change smart ping state from : EMEvaluating to : EMReevaluating
12-08 17:44:57.114: D/EMChatManager(23769): manually force to reconnect to server
12-08 17:44:57.114: D/EMConnectionManager(23769): enter reConnect
12-08 17:44:57.124: I/sxmppcon(23769): enter disconnect (1110771456)
12-08 17:44:57.129: D/sxmppcon(23769): (1110771456) shutdown
12-08 17:44:57.139: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <presence id="0b8eB-6" type="unavailable"></presence>
12-08 17:44:57.139: D/EMConnectionManager(23769): connectionClosed
12-08 17:44:57.149: D/EMConnectionManager(23769): on disconnected
12-08 17:44:57.159: D/SMACK:FileDebugger(23769):  Connection closed (1110771456)
12-08 17:44:57.169: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): </stream:stream>
12-08 17:44:57.319: D/sxmppcon(23769): trying to close the socket : Socket[address=/182.92.20.117,port=443,localPort=57759]
12-08 17:44:57.324: D/sxmppcon(23769): (1110771456) socket was closed
12-08 17:44:57.324: I/sxmppcon(23769): shutdown was called
12-08 17:44:57.324: D/EMConnectionManager(23769): register connectivity receiver.
12-08 17:44:57.334: D/EMConnectionManager(23769): connectivity receiver onReceiver
12-08 17:44:57.334: D/EMConnectionManager(23769): 1109671328 : enter startReconnectionThread()
12-08 17:44:57.339: D/net(23769): has wifi connection
12-08 17:44:57.339: D/net(23769): has wifi connection
12-08 17:44:57.344: D/EMConnectionManager(23769): start reconnectionThread()
12-08 17:44:57.349: D/smart ping(23769): schedule next alarm
12-08 17:44:57.349: D/smart ping(23769): current heartbeat interval : 03:00:000 smart ping state : EMReevaluating
12-08 17:44:57.354: D/EMConnectionManager(23769): run in reconnectionThread
12-08 17:44:57.359: D/net(23769): has wifi connection
12-08 17:44:57.359: D/smart ping(23769): is not connected to server, so use idle interval : 3 mins
12-08 17:44:58.414: D/EMConnectionManager(23769): run in reconnectionThread with connection 1110771456
12-08 17:44:58.424: D/net(23769): has wifi connection
12-08 17:44:58.429: D/EMConnectionManager(23769): try to reconnectSync
12-08 17:44:58.434: D/EMConnectionManager(23769): enter connectSync
12-08 17:44:58.444: D/EMConnectionManager(23769): connection manager:connect
12-08 17:44:58.444: D/EMConnectionManager(23769): before connect
12-08 17:44:58.449: D/sxmppcon(23769): try to connect to host : 182.92.20.117 port : 443
12-08 17:44:58.494: D/sxmppcon(23769): open a new socket : Socket[address=/182.92.20.117,port=443,localPort=36494]
12-08 17:44:58.509: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <stream:stream to="easemob.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
12-08 17:44:58.554: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='2349535746' from='easemob.com' version='1.0' xml:lang='en'><stream:features><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.easemob.com/' ver='pNSTsv0+8X2VCrBE7jESku4qtkk='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
12-08 17:44:58.569: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <compress xmlns='http://jabber.org/protocol/compress'>
12-08 17:44:58.574: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <method>zlib</method></compress>
12-08 17:44:58.809: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <compressed xmlns='http://jabber.org/protocol/compress'/>
12-08 17:44:58.809: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <stream:stream to="easemob.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
12-08 17:44:58.819: D/SASLAuthentication(23769): waiting for authentiation response!
12-08 17:44:58.824: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">c3RudHMjdGl0YXRlc3RfdGl0YV8xMDAwNTAAc3RudHMjdGl0YXRlc3RfdGl0YV8xMDAwNTAAc0dLc0dYUkUxWWtlb0tKTEhXRE5IUT09</auth>
12-08 17:44:58.884: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3570312879' from='easemob.com' version='1.0' xml:lang='en'>
12-08 17:44:58.904: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.easemob.com/' ver='pNSTsv0+8X2VCrBE7jESku4qtkk='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features><success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
12-08 17:44:58.929: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <stream:stream to="easemob.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
12-08 17:44:59.004: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3321336062' from='easemob.com' version='1.0' xml:lang='en'>
12-08 17:44:59.024: D/dalvikvm(23769): GC_CONCURRENT freed 2015K, 26% free 22184K/29831K, paused 22ms+15ms, total 136ms
12-08 17:44:59.024: D/dalvikvm(23769): WAIT_FOR_CONCURRENT_GC blocked 17ms
12-08 17:44:59.024: D/dalvikvm(23769): WAIT_FOR_CONCURRENT_GC blocked 18ms
12-08 17:44:59.034: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <stream:features><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/><ver xmlns='urn:xmpp:features:rosterver'/><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.easemob.com/' ver='pNSTsv0+8X2VCrBE7jESku4qtkk='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
12-08 17:44:59.039: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-8" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>mobile</resource></bind></iq>
12-08 17:44:59.074: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <iq id='0b8eB-8' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>easemob.com/mobile</jid></bind></iq>
12-08 17:44:59.074: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-9" type="set"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
12-08 17:44:59.109: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <iq type='result' id='0b8eB-9'/>
12-08 17:44:59.114: D/SMACK:FileDebugger(23769): User logged (1110771456): @easemob.com@easemob.com:443/mobile
12-08 17:44:59.114: D/EMConnectionManager(23769): reconnectionSuccessful
12-08 17:44:59.119: D/EMConnectionManager(23769): send version iq
12-08 17:44:59.119: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <iq id="0b8eB-10" to="easemob.com" from="@easemob.com" type="result"><query xmlns="jabber:iq:version"><name>easemob</name><version>2.2.4</version><os>android</os></query></iq>
12-08 17:44:59.124: D/EMConnectionManager(23769): send available presence after reconnected
12-08 17:44:59.124: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <presence id="0b8eB-11"></presence>
12-08 17:44:59.124: D/EMChatManager(23769): reconnectionSuccessful
12-08 17:44:59.129: D/SMACK:FileDebugger(23769):  Connection reconnected (1110771456)
12-08 17:44:59.129: D/EMConnectionManager(23769): after connect
12-08 17:44:59.129: D/EMConnectionManager(23769): enter initConnection()
12-08 17:44:59.134: D/EMConnectionManager(23769): already login. skip
12-08 17:44:59.134: D/[Collector][Login][im login time](23769): im login time : 00:00:690
12-08 17:44:59.134: D/smart ping(23769):  onConnectred ...
12-08 17:44:59.134: D/EMChatManager(23769): onConnectionSuccessful
12-08 17:44:59.134: D/smart ping(23769): schedule next alarm
12-08 17:44:59.139: D/smart ping(23769): current heartbeat interval : 03:00:000 smart ping state : EMReevaluating
12-08 17:44:59.139: D/sender(23769): start flush Pending Queue
12-08 17:44:59.144: D/net(23769): has wifi connection
12-08 17:44:59.144: I/(23769): ################################
12-08 17:44:59.144: I/(23769): ############聊天服务器已连接############
12-08 17:44:59.144: I/(23769): ####################################
12-08 17:44:59.154: D/smart ping(23769):  onConnectred ...
12-08 17:44:59.159: D/smart ping(23769): schedule next alarm
12-08 17:44:59.159: D/smart ping(23769): current heartbeat interval : 03:00:000 smart ping state : EMReevaluating
12-08 17:44:59.159: D/net(23769): has wifi connection
12-08 17:44:59.189: I/(23769): ################################
12-08 17:44:59.189: I/(23769): ############聊天服务器已连接############
12-08 17:44:59.189: I/(23769): ####################################
12-08 17:44:59.279: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <message from='stnts#@easemob.com' to='stnts#@easemob.com' id='137451629946339956' type='chat'><body>{"from":"","to":"","bodies":[{"type":"txt","msg":":smiley::wink::disappointed_relieved::joy:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}</body><thread>56DDR0</thread><delay xmlns='urn:xmpp:delay' stamp='2015-12-08T09:42:31.486Z'/></message>
12-08 17:44:59.284: D/chat(23769): temp acquire 3s
12-08 17:44:59.289: D/chat(23769): send ack message back to server:org.jivesoftware.smack.packet.Message@b4fff167
12-08 17:44:59.289: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <message id="137451629946339956" to="easemob.com" from="stnts#@easemob.com"><received xmlns="urn:xmpp:receipts" id="137451629946339956"/></message>
12-08 17:44:59.294: D/chat(23769): chat listener receive msg from:stnts#@easemob.com body:{"from":"","to":"","bodies":[{"type":"txt","msg":":smiley::wink::disappointed_relieved::joy:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}
12-08 17:44:59.294: D/EMConversationManager(23769): save message:137451629946339956
12-08 17:44:59.294: D/EMConversationManager(23769): get conversation for user:
12-08 17:44:59.299: D/EMDBManager(23769): add converstion with:
12-08 17:44:59.304: D/SMACK:FileDebugger(23769):  RCV from182.92.20.117:443(1110771456): <message from='stnts#@easemob.com' to='stnts#@easemob.com' id='137451643410055796' type='chat'><body>{"from":"","to":"","bodies":[{"type":"txt","msg":":sweat::sleeping::fearful::scream::scream:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}</body><thread>56DDR0</thread><delay xmlns='urn:xmpp:delay' stamp='2015-12-08T09:42:34.623Z'/></message><message from='stnts#@easemob.com' to='stnts#@easemob.com' id='137451695620751988' type='chat'><body>{"from":"","to":"","bodies":[{"type":"txt","msg":":heart::heart::heart::heart::heart::heart:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}</body><thread>56DDR0</thread><delay xmlns='urn:xmpp:delay' stamp='2015-12-08T09:42:46.783Z'/></message>
12-08 17:44:59.309: D/EMDBManager(23769): save msg to db
12-08 17:44:59.314: D/EMDBManager(23769): add converstion with:
12-08 17:44:59.319: D/EMOfflineMessageHandler(23769):  offline msg, do not send notify for msg:137451629946339956
12-08 17:44:59.324: D/EMOfflineMessageHandler(23769): start offline notify thread...
12-08 17:44:59.324: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <message id="137451643410055796" to="easemob.com" from="stnts#@easemob.com"><received xmlns="urn:xmpp:receipts" id="137451643410055796"/></message>
12-08 17:44:59.324: D/chat(23769): send ack message back to server:org.jivesoftware.smack.packet.Message@b4fff167
12-08 17:44:59.324: D/chat(23769): chat listener receive msg from:stnts#@easemob.com body:{"from":"","to":"","bodies":[{"type":"txt","msg":":sweat::sleeping::fearful::scream::scream:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}
12-08 17:44:59.324: D/EMConversationManager(23769): save message:137451643410055796
12-08 17:44:59.329: D/EMConversationManager(23769): get conversation for user:
12-08 17:44:59.329: D/EMDBManager(23769): add converstion with:
12-08 17:44:59.334: D/EMDBManager(23769): save msg to db
12-08 17:44:59.334: D/EMDBManager(23769): add converstion with:
12-08 17:44:59.339: D/EMOfflineMessageHandler(23769):  offline msg, do not send notify for msg:137451643410055796
12-08 17:44:59.339: D/SMACK:FileDebugger(23769):  SENT to182.92.20.117:443(1110771456): <message id="137451695620751988" to="easemob.com" from="stnts#@easemob.com"><received xmlns="urn:xmpp:receipts" id="137451695620751988"/></message>
12-08 17:44:59.339: D/chat(23769): send ack message back to server:org.jivesoftware.smack.packet.Message@b4fff167
12-08 17:44:59.339: D/chat(23769): chat listener receive msg from:stnts#t@easemob.com body:{"from":"","to":"","bodies":[{"type":"txt","msg":":heart::heart::heart::heart::heart::heart:"}],"ext":{"user_game_nickname":"啦啦","qd_id":"100062","msg_user_icon":"2015120413343405581.jpg","msg_user_name":"啦啦","groupType":""}}
12-08 17:44:59.344: D/EMConversationManager(23769): save message:137451695620751988
12-08 17:44:59.344: D/EMConversationManager(23769): get conversation for user:
12-08 17:44:59.349: D/EMDBManager(23769): add converstion with:ti
12-08 17:44:59.354: D/EMDBManager(23769): save msg to db
12-08 17:44:59.354: D/EMDBManager(23769): add converstion with:
12-08 17:44:59.354: D/EMOfflineMessageHandler(23769):  offline msg, do not send notify for msg:137451695620751988
12-08 17:45:02.329: D/EMOfflineMessageHandler(23769): send offline message broadcast for users:1
12-08 17:45:02.339: D/EMOfflineMessageHandler(23769): send offline message broadcast for groups:0
12-08 17:45:02.359: D/EMChatManager(23769): broad offline msg
12-08 17:45:02.379: D/notify(23769): send new message broadcast for msg:137451695620751988
12-08 17:45:02.394: D/notify(23769): publish event, event type: EventOfflineMessage

要回复问题请先登录注册