Skip to content

Commit

Permalink
Attempt to fix lobby connection error. (#12054)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine authored Oct 24, 2023
1 parent 59747d1 commit 45b1413
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -44,7 +45,8 @@ public class GenericWebSocketClient implements WebSocket, WebSocketConnectionLis
private final Function<URI, WebSocketConnection> webSocketConnectionFactory;

private WebSocketConnection webSocketConnection;
private final Set<MessageListener<? extends WebSocketMessage>> listeners = new HashSet<>();
private final Set<MessageListener<? extends WebSocketMessage>> listeners =
Collections.synchronizedSet(new HashSet<>());

@Builder
private static class MessageListener<T extends WebSocketMessage> {
Expand Down Expand Up @@ -147,6 +149,7 @@ public void connectionTerminated(final String reason) {

@Override
public void handleError(final Throwable exception) {
log.error("Web Socket error", exception);
errorHandler.accept(exception.getMessage());
}
}

0 comments on commit 45b1413

Please sign in to comment.