SocketException 兼容测试报的异常

android
标签: #<Tag:0x00007fb83f670490>

(Big Karel) #1

测试同学做了兼容测试,出了两个bug:

java.net.SocketException: sendto failed: ENETUNREACH (Network is unreachable)
	at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:499)
	at libcore.io.IoBridge.sendto(IoBridge.java:468)
	at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:182)
	at java.net.DatagramSocket.send(DatagramSocket.java:281)
	at cn.jiguang.b.d.c.a(Unknown Source)
	at cn.jiguang.b.b.g.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
	at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: sendto failed: ENETUNREACH (Network is unreachable)
	at libcore.io.Posix.sendtoBytes(Native Method)
	at libcore.io.Posix.sendto(Posix.java:156)
	at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
	at libcore.io.IoBridge.sendto(IoBridge.java:466)
	... 7 more


	java.net.SocketTimeoutException
	at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:551)
	at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
	at java.net.PlainDatagramSocketImpl.doRecv(PlainDatagramSocketImpl.java:161)
	at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:169)
	at java.net.DatagramSocket.receive(DatagramSocket.java:250)
	at cn.jiguang.b.d.c.a(Unknown Source)
	at cn.jiguang.b.b.g.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
	at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: recvfrom failed: EAGAIN (Try again)
	at libcore.io.Posix.recvfromBytes(Native Method)
	at libcore.io.Posix.recvfrom(Posix.java:141)
	at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
	at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
	... 8 more

不知道什么原因啊


#2

如果是debug版本OK,release版本长连接无故断开,应是混淆方面的原因,根据文档的混淆要求处理一下。


(Big Karel) #3

debug版本