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

When receive onClosing () callback, Should I must manually call close () method to close the resources? #3386

Closed
lixingmao opened this issue Jun 5, 2017 · 1 comment
Labels
documentation Documentation task

Comments

@lixingmao
Copy link

When I use okhttp to achieve WebSocket connection, when received onClosing (WebSocket webSocket, int code, String reason) callback, whether the call must be manually () method to close the resources?
See the source code found that if the client is passive disconnect, do not manually call the close () method will lead to onClosed (WebSocket webSocket, int code, String reason) method can not callback, the resources can not be recycled. The actual situation is indeed the case Happening.
If it is necessary, should it be emphasized in the document or comment?

@swankjesse
Copy link
Member

You must call either close or cancel on every WebSocket you create. We should add this to our documentation.

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

No branches or pull requests

2 participants