Skip to content

Commit 3fee52c

Browse files
committed
Do not use the disconnect method to tear down on pong timeout
The `disconnect` method is public, and tests the current state before taking action, scheduling this work to happen on the event thread. However, when a pong times out, the `onClose` is executed immediately, transitioning in to the reconnecting state before the scheduled disconnect happens, meaning disconnect fails to take any action and potentially resulting in the old connection not being torn down.
1 parent 979d537 commit 3fee52c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public void run() {
403403

404404
underlyingConnection.removeWebSocketListener();
405405

406-
disconnect();
406+
underlyingConnection.close();
407407

408408
// Proceed immediately to handle the close
409409
// The WebSocketClient will attempt a graceful WebSocket shutdown by exchanging the close frames

0 commit comments

Comments
 (0)