Answer the question
In order to leave comments, you need to log in
Centrifuge Java - Why is listener underlined in red?
Hello, I recently started studying the Centrifuge-Java library, read Basic usage, and started writing on the first error.
EventListener listener = new EventListener() {
@Override
public void onConnect(Client client, ConnectEvent event) {
System.out.println("connected");
}
@Override
public void onDisconnect(Client client, DisconnectEvent event) {
System.out.printf("disconnected %s, reconnect %s%n", event.getReason(), event.getReconnect());
}
};
Client client = new Client(
"ws://localhost:8000/connection/websocket?format=protobuf",
new Options(),
listener
);
client.connect();
Answer the question
In order to leave comments, you need to log in
Maybe you imported the wrong EventListener? In general, the reason for the error is usually written next to the red underline.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question