From 17ed3a052eb8edad27eb60b3ca3813cb5c46ab07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Amor=C3=ADn?= Date: Fri, 26 Jul 2024 11:44:39 -0300 Subject: [PATCH] Only remove first time handshake failures --- .../socketio/transport/WebSocketTransport.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/corundumstudio/socketio/transport/WebSocketTransport.java b/src/main/java/com/corundumstudio/socketio/transport/WebSocketTransport.java index ca7cc0a1..67705037 100644 --- a/src/main/java/com/corundumstudio/socketio/transport/WebSocketTransport.java +++ b/src/main/java/com/corundumstudio/socketio/transport/WebSocketTransport.java @@ -183,8 +183,11 @@ private void closeClient(UUID sessionId, Channel channel) { } catch (Throwable t) { log.warn("Can't close channel for sessionId: {}", sessionId, t); } - ClientHead clientHead = clientsBox.removeClient(sessionId); - clientHead.disconnect(); + ClientHead clientHead = clientsBox.get(sessionId); + if (clientHead != null && clientHead.getNamespaces().isEmpty()) { + clientsBox.removeClient(sessionId); + clientHead.disconnect(); + } log.info("Client with sessionId: {} was disconnected", sessionId); }