Skip to content

Commit 792030a

Browse files
authored
Merge pull request #1241 from xwang1498/fix/okhttp-websocket-onclosing
fix(okhttp): complete the close handshake when the server closes the websocket
2 parents e158c41 + 014f7d3 commit 792030a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎network-client-okhttp/src/main/java/io/ably/lib/network/OkHttpWebSocketClient.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ private WebSocketHandler(WebSocketListener listener) {
5959
this.listener = listener;
6060
}
6161

62+
@Override
63+
public void onClosing(WebSocket webSocket, int code, String reason) {
64+
webSocket.close(1000, null);
65+
}
66+
6267
@Override
6368
public void onClosed(WebSocket webSocket, int code, String reason) {
6469
listener.onClose(code, reason);

0 commit comments

Comments
 (0)