T
T
TTXSTM2022-03-26 18:38:37
Java
TTXSTM, 2022-03-26 18:38:37

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();


Why is listener underlined in red?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hrozhek, 2022-03-26
@TTXSTM

Maybe you imported the wrong EventListener? In general, the reason for the error is usually written next to the red underline.

J
Jacen11, 2022-03-27
@Jacen11

the first error appeared.
so what?
Why is listener underlined in red?
because there is an error

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question