TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.

Home Page:http://tootallnate.github.io/Java-WebSocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebSocketImpl.lastPong is not updated on PONG

entlicher opened this issue · comments

Describe the bug
WebSocketImpl.lastPong is not updated on PONG sent from the client and as a result the connection is canceled on timeout.

To Reproduce

  1. The only entity that updates the lastPong is Draft_6455 (calls webSocketImpl.updateLastPong() when it receives PONG)
  2. However, WebSocketServer does not use any Draft by default.
  3. The bug occurs because the timeout is implemented in the web-socket, but it's updated only in a draft that the web-socket might not use.
  4. Passing List.of(new Draft_6455()) to the constructor of WebSocketServer solves this issue, but since WebSocketServer works perfectly fine without it, this is unintuitive. The update of lastPong from one of the drafts looks wrong.

Additional context
I think that issue #1061 may be about the same problem.

Getting the same error, server disconnect the client and on the client side it didn't notify.

Unable to reproduce the issue.
If there is no draft provided, a Draft_6455 will be used.
https://github.com/TooTallNate/Java-WebSocket/blob/master/src/main/java/org/java_websocket/WebSocketImpl.java#L192

Closing this issue for now