默认
发表评论 2
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
[已回复] MobileIMSDK的android端当手机黑屏后,再次唤醒手机的异常信息解读
阅读(34470) | 评论(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/imservice@native@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后,它已处于一个非正常的状态(即脏现场),后绪的操作当然会报乱七八糟与此有关的异常了。总之,算法有治愈能力,可以恢复就不存在任何问题,属于算法可以掌控的范围内的非正常情况。
思密达
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部