Skip to content

Lost connection detection is sensitive to changes in system time #869

@ItsHarper

Description

@ItsHarper

Because Lost Connection Detection uses the java.util.Timer API instead of the ScheduledThreadPoolExecutor API, it is sensitive to changes in the system time. For example, if you set the system time to a point years in the future, the connectionLostTimerTask will be called constantly, frequently causing disconnects as the clients cannot respond before the task is called again. This is particularly an issue for embedded devices that must have their clock set at runtime.

The best solution would seem to be to use the ScheduledThreadPoolExecutor API. I plan to submit a PR.

To Reproduce

  1. Start a WebSocket server using this library
  2. Set the system time to a few years in the future

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions