-
Notifications
You must be signed in to change notification settings - Fork 172
Close the web socket after sending a close frame. #61
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
Conversation
Previously, the underlying socket was being closed with the cancel call. Because the socket was closed, the close frame could never be sent.
I tried this. |
@xuduo this fixes one scenario where the RejectedExecutionException can happen. There may be others. If you can provide any information on your usage, please let me know. |
@dave-r12 do this fix socketio/socket.io-client-java#295 also. @nkzawa can we have it reviewed and merged. square/okhttp#2455 |
@joshimohit I don't think it fixes that one. If you could provide any information on how you generate that exception, I can try to look into it. |
@dave-r12 : we have been facing issues with Webscoket getting closed when socket is disconnecting and message is sent . in this case exception is received either on RealWebSocket.close() or RealWebsocket.onMessage. Generally, it happens in very low network conditions. let me know if you can help |
@joshimohit is the server disconnecting or is the client disconnecting? I'll have a look. |
@dave-r12 : We have observed this in very low internet bandwidth, when client- socket gets disconnected automatically. Below are steps to reproduce it :
|
Hey @dave-r12 were you able to produce the bug ? |
I haven't looked, maybe in the next couple days. |
@dave-r12 any update? I'm asking because it's a really big problem in our most popular app. |
I solved this by try catch in okhttp source code. |
@xuduo We are using Socket 0.7.0 in our Android App which inturn uses okhttp version 3.0.1. Fix you are suggesting is in okhttp v 3.4.1 ? Is socketIO Library compatible with this okhttp version (3.4.1) ? What is version of okhttp-ws you are using ? |
@joshimohit I use okhttp & okhttp-ws 3.4.1 with socket.io 0.7.0 , works fine. Might need some of your code if you are using https. |
@xuduo |
Crash rate reduced, I guess this exception happens when client try to reconnect, or Android is shutting down my app.No defects have been reported. |
@xuduo |
@PiotrWpl That's a revert to a change I made earlier which didn't work,It instead caused a stack overflow. |
Is there something I can do to get this merged in? |
Thanks @nkzawa! |
@dave-r12 Thanks for your awesome PR, and sorry for the delay! I will release the next version asap. |
@nkzawa, When shall we expect next release ? onClose issue and okhttp issue On Sat, Sep 3, 2016 at 9:20 AM, Naoyuki Kanezawa notifications@github.com
|
Previously, the underlying socket was being closed with the cancel call.
Because the socket was closed, the close frame could never be sent.