Skip to content

Conversation

@ckwong17
Copy link

Inside Android's Okhttp onClosing callback, we need to manually close the websocket, in order to trigger a reconnect. square/okhttp#3386

Inside Android's Okhttp onClosing callback, we need to manually close the websocket, in order to trigger a reconnect.
square/okhttp#3386

override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
this.readyState = Transport.ReadyState.CLOSING
webSocket.close(code, reason)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also modify the WebSocketTransportTest to include this please?

    internal fun `sets ready state to CLOSING`() {
      ...

      transport.onClosing(mockWebSocket, 10, "reason")
      verify(mockWebSocket).close(10, "reason")
      ...
    }

andrews-moc added a commit to salemove/JavaPhoenixClient that referenced this pull request Aug 2, 2023
This is the same as dsrees#90 but with unit test update
andrews-moc added a commit to salemove/JavaPhoenixClient that referenced this pull request Aug 2, 2023
This is the same as dsrees#90 but with unit test update
@dsrees dsrees closed this Aug 2, 2023
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

Successfully merging this pull request may close these issues.

2 participants