Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix lobby connection error. #12054

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}