Skip to content

Commit f33dea9

Browse files
author
Daniel Rees
committed
Removed check of connectexception
1 parent 4c7db7a commit f33dea9

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/main/kotlin/org/phoenixframework/Transport.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ class WebSocketTransport(
135135
this.readyState = Transport.ReadyState.CLOSED
136136
this.onError?.invoke(t, response)
137137

138-
// Do not attempt to recover if the initial connection was refused
139-
if (t is ConnectException) return
140-
141138
// Check if the socket was closed for some recoverable reason
142139
if (t is SocketException) {
143140
this.onClosed(webSocket, WS_CLOSE_SOCKET_EXCEPTION, "Socket Exception")

src/test/kotlin/org/phoenixframework/WebSocketTransportTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.google.common.truth.Truth.assertThat
44
import com.nhaarman.mockitokotlin2.any
55
import com.nhaarman.mockitokotlin2.mock
66
import com.nhaarman.mockitokotlin2.verify
7-
import com.nhaarman.mockitokotlin2.verifyZeroInteractions
87
import com.nhaarman.mockitokotlin2.whenever
98
import okhttp3.OkHttpClient
109
import okhttp3.Response
@@ -74,8 +73,6 @@ class WebSocketTransportTest {
7473
@Test
7574
fun `onFailure sets ready state to CLOSED and invokes onError callback`() {
7675
val mockClosure = mock<(Throwable, Response?) -> Unit>()
77-
val mockOnClose = mock<(Int) -> Unit>()
78-
transport.onClose = mockOnClose
7976
transport.onError = mockClosure
8077

8178
transport.readyState = Transport.ReadyState.CONNECTING
@@ -84,7 +81,6 @@ class WebSocketTransportTest {
8481
transport.onFailure(mockWebSocket, throwable, mockResponse)
8582
assertThat(transport.readyState).isEqualTo(Transport.ReadyState.CLOSED)
8683
verify(mockClosure).invoke(throwable, mockResponse)
87-
verifyZeroInteractions(mockOnClose)
8884
}
8985

9086
@Test

0 commit comments

Comments
 (0)