You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When receive onClosing () callback, Should I must manually call close () method to close the resources? #3386
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?
Activity
swankjesse commentedon Jun 10, 2017
You must call either close or cancel on every WebSocket you create. We should add this to our documentation.
Clarify documentation on closing WebSockets and Responses.
Fix webSocket not closed in onClosing