默認
發表評論 2
[已回復] MobileIMSDK的android端當手機黑屏后,再次喚醒手機的異常信息解讀
閱讀(335) | 評論(2 收藏 淘帖1
UDPUtils.send 中報錯了,雖然最后是能鏈接上,但是總感覺不爽,
是什么原因導致的呢? 各位大佬,看看呢
06-12 00:59:41.650 6903-10844/com.srbl.mytx W/LocalUDPDataReciever: 【IMCORE】本地UDP監聽停止了(socket被關閉了?):,應該是用戶退出登陸或網絡斷開了。
06-12 00:59:41.651 6903-7168/com.srbl.mytx E/UDPUtils: 【IMCORE】send方法中》》發送UDP數據報文時出錯了,原因是:sendto failed: EPERM (Operation not permitted)
    java.net.SocketException: sendto failed: EPERM (Operation not permitted)
        at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:542)
        at libcore.io.IoBridge.sendto(IoBridge.java:511)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendKeepAlive(LocalUDPDataSender.java:136)
        at net.openmob.mobileimsdk.android.core.KeepAliveDaemon$1$1.doInBackground(KeepAliveDaemon.java:146)
        at net.openmob.mobileimsdk.android.core.KeepAliveDaemon$1$1.doInBackground(KeepAliveDaemon.java:137)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: android.system.ErrnoException: sendto failed: EPERM (Operation not permitted)
        at libcore.io.Posix.sendtoBytes(Native Method)
        at libcore.io.Posix.sendto(Posix.java:211)
        at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
        at libcore.io.IoBridge.sendto(IoBridge.java:509)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendKeepAlive(LocalUDPDataSender.java:136)
        at net.openmob.mobileimsdk.android.core.KeepAliveDaemon$1$1.doInBackground(KeepAliveDaemon.java:146)
        at net.openmob.mobileimsdk.android.core.KeepAliveDaemon$1$1.doInBackground(KeepAliveDaemon.java:137)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
06-12 00:59:41.663 6903-6903/com.srbl.mytx E/IMClientManager: 【DEBUG_UI】與IM服務器的網絡連接出錯關閉了,error:-1
06-12 00:59:41.686 6903-7167/com.srbl.mytx E/UDPUtils: 【IMCORE】send方法中》》發送UDP數據報文時出錯了,原因是:sendto failed: EPERM (Operation not permitted)
    java.net.SocketException: sendto failed: EPERM (Operation not permitted)
        at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:542)
        at libcore.io.IoBridge.sendto(IoBridge.java:511)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendLogin(LocalUDPDataSender.java:82)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:119)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:108)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: android.system.ErrnoException: sendto failed: EPERM (Operation not permitted)
        at libcore.io.Posix.sendtoBytes(Native Method)
        at libcore.io.Posix.sendto(Posix.java:211)
        at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
        at libcore.io.IoBridge.sendto(IoBridge.java:509)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendLogin(LocalUDPDataSender.java:82)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:119)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:108)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
06-12 00:59:42.612 6903-6903/com.srbl.mytx I/_adjTransferRate: UT:millseconds:30000
06-12 00:59:42.626 6903-6903/com.srbl.mytx I/Native: InetIO_SetForeground 1
06-12 00:59:42.626 6903-6903/com.srbl.mytx I/[email protected]@im: setForeground:1
06-12 00:59:43.696 6903-7179/com.srbl.mytx E/UDPUtils: 【IMCORE】send方法中》》發送UDP數據報文時出錯了,原因是:sendto failed: ECONNREFUSED (Connection refused)
    java.net.SocketException: sendto failed: ECONNREFUSED (Connection refused)
        at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:542)
        at libcore.io.IoBridge.sendto(IoBridge.java:511)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendLogin(LocalUDPDataSender.java:82)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:119)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:108)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: android.system.ErrnoException: sendto failed: ECONNREFUSED (Connection refused)
        at libcore.io.Posix.sendtoBytes(Native Method)
        at libcore.io.Posix.sendto(Posix.java:211)
        at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
        at libcore.io.IoBridge.sendto(IoBridge.java:509)
        at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:184)
        at java.net.DatagramSocket.send(DatagramSocket.java:305)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:88)
        at net.openmob.mobileimsdk.android.utils.UDPUtils.send(UDPUtils.java:50)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.send(LocalUDPDataSender.java:283)
        at net.openmob.mobileimsdk.android.core.LocalUDPDataSender.sendLogin(LocalUDPDataSender.java:82)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:119)
        at net.openmob.mobileimsdk.android.core.AutoReLoginDaemon$1$1.doInBackground(AutoReLoginDaemon.java:108)
        at android.os.AsyncTask$2.call(AsyncTask.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
06-12 00:59:45.732 6903-6903/com.srbl.mytx I/IMClientManager: 【DEBUG_UI】IM服務器登錄/重連成功!

即時通訊網 - 即時通訊開發者社區! 來源: - 即時通訊開發者社區!

標簽:MobileIMSDK
上一篇:[已回復] 請教!MobileIMSDK 如何實現聊天室的功能?下一篇:[已回復] 求教MobileIMSDK的聊天消息應答ack邏輯的疑問?

本帖已收錄至以下技術專輯

推薦方案
評論 2
這樣的異常不用理會,因為每個廠商的ROOM里,對于熄屏省電的理解和策略都不同,所以到底是什么具體的方式讓你的socket處于無法工作狀態都不重要(或者說你是無法預測到底是什么方式,因為廠商太多了,方法也太多了),重要的是能在亮屏后依靠自動治愈算法恢復就行了。

你如果非得糾結這個異常的原因,那基本上最 大的可能就是廠商通過省電策略禁了你的socket后,它已處于一個非正常的狀態(即臟現場),后緒的操作當然會報亂七八糟與此有關的異常了。總之,算法有治愈能力,可以恢復就不存在任何問題,屬于算法可以掌控的范圍內的非正常情況。
簽名: 《對比主流分布式MQ消息隊列,媽媽再也不擔心我的技術選型了》http://www.uktmgv.tw/thread-2625-1-1.html
思密達
打賞樓主 ×
使用微信打賞! 使用支付寶打賞!

返回頂部
曾氏料二肖中特