Skip to content

NullPointerException in SocketChannelIOHelper when ping to server #388

@picolino0

Description

@picolino0

I used http://www.yougetsignal.com/tools/open-ports/ to check if the port of my server was open. When I'm connected with my server via simple Javascript websockets and then ping using that website, I get the following exception:
java.lang.NullPointerException at org.java_websocket.SocketChannelIOHelper.read(SocketChannelIOHelper.java:14) at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:322) at java.lang.Thread.run(Unknown Source)

That's all. So this can't be because of my own code.

I tried to solve it by adding
// Ignore if channel is null if (conn.channel == null) continue;

right above the if (SocketChannelIOHelper.read(buf, conn, conn.channel)). This prevents the server from crashing and there's no exception. However, the websocket is still closed and im unable to reconnected without restarting the server.

I'm running a TLS server if that makes any difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions