Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我这个日志一直在打印 onClosed:code= 1000 onOpen #14

Closed
niantuo opened this issue Feb 1, 2018 · 1 comment
Closed

Comments

@niantuo
Copy link

niantuo commented Feb 1, 2018

我用您的连接,都么有问题,但是日志一直打印
ebSocketUtil: ws://192.168.1.33:7181 --> onClosed:code= 1000
02-01 17:30:30.483 12998-13029/cn.gygxzc.tony.asr D/RxWebSocketUtil: ws://192.168.1.33:7181 --> onOpen
02-01 17:30:30.484 12998-12998/cn.gygxzc.tony.asr I/SocketService: onOpen->okhttp3.internal.ws.RealWebSocket@43e1e1f8
02-01 17:30:33.596 12998-13236/cn.gygxzc.tony.asr D/dalvikvm: JIT unchain all for threadid=23
02-01 17:30:33.824 12998-13236/cn.gygxzc.tony.asr D/dalvikvm: GC_FOR_ALLOC freed 504K, 11% free 36741K/40840K, paused 477ms, total 477ms
02-01 17:30:39.777 12998-13242/cn.gygxzc.tony.asr D/dalvikvm: JIT unchain all for threadid=23
02-01 17:30:40.005 12998-13242/cn.gygxzc.tony.asr D/dalvikvm: GC_FOR_ALLOC freed 475K, 11% free 36742K/40840K, paused 477ms, total 477ms
02-01 17:30:40.501 12998-13029/cn.gygxzc.tony.asr D/RxWebSocketUtil: ws://192.168.1.33:7181 --> onClosed:code= 1000
02-01 17:30:42.508 12998-13029/cn.gygxzc.tony.asr D/RxWebSocketUtil: ws://192.168.1.33:7181 --> onOpen
02-01 17:30:42.509 12998-12998/cn.gygxzc.tony.asr I/SocketService: onOpen->okhttp3.internal.ws.RealWebSocket@43e1d120
能请问一下这个属于什么情况吗?

@dhhAndroid
Copy link
Owner

从日志上看,是出现了WebSocket连接出现了反复开关闭的现象,如果服务端关闭WebSocket,会向客户端发送关闭消息,我这边接受到了关闭消息,就关闭WebSocket.连接.目前我没有发现有开发者反馈这种问题,你看下是否是你的调用方式有问题,或着是服务端主动关闭了WebSocket连接.我目前能想到的可能问题就是两个. 点击查看相关逻辑代码.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants