Skip to content

java.nio.channels.CancelledKeyException #168

@aftersss

Description

@aftersss

sometimes the server throws this exception and stop working, other clients can not connect to the server again.I guess this happens when a client close the connection as soon as it is connectted.
The exception stack trace is:
java.nio.channels.CancelledKeyException: null
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:73) ~[na:1.7.0_07]
at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:82) ~[na:1.7.0_07]
at org.java_websocket.server.WebSocketServer.onWriteDemand(WebSocketServer.java:532) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.WebSocketImpl.write(WebSocketImpl.java:635) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.WebSocketImpl.sendFrame(WebSocketImpl.java:576) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.WebSocketImpl.close(WebSocketImpl.java:407) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:335) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157) ~[WebSocket-1.3.0.jar:na]
at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:652) ~[WebSocket-1.3.0.jar:na]

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