We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f50d28 commit 1192d46Copy full SHA for 1192d46
src/main/java/info/unterrainer/websocketserver/AiComm.java renamed to src/test/java/info/unterrainer/websocketserver/AiComm.java
@@ -3,6 +3,7 @@
3
import java.util.Set;
4
import java.util.concurrent.ConcurrentHashMap;
5
6
+import io.javalin.websocket.WsCloseContext;
7
import io.javalin.websocket.WsConnectContext;
8
import io.javalin.websocket.WsMessageContext;
9
import lombok.extern.slf4j.Slf4j;
@@ -19,6 +20,11 @@ public void onConnect(WsConnectContext ctx) throws Exception {
19
20
ctx.send("Welcome to our websocket-server!");
21
}
22
23
+ @Override
24
+ public void onClose(WsCloseContext ctx) {
25
+ connectedWsClients.removeIf(client -> client.session.equals(ctx.session));
26
+ }
27
+
28
@Override
29
public void onMessage(WsMessageContext ctx) throws Exception {
30
super.onMessage(ctx);
0 commit comments