Closed RustedBones closed 1 year ago
Fixes #140
When WebSocket.disconnec(closeCode, reason, closeDelay) is called and the close frame is not received from the server, the CloseTask fires.
WebSocket.disconnec(closeCode, reason, closeDelay)
CloseTask
However, in this case, no cancelCloseTask is called, leading to leave the thread from the close timer waiting for a new task.
cancelCloseTask
Solution: If CloseTask fires, cancel the timer since it is used for a one time scheduling only.
As stated in the [Timer](https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html#cancel()) Javadoc, it is safe to cancel within the task
Timer
staled project. closing PR
Fixes #140
When
WebSocket.disconnec(closeCode, reason, closeDelay)
is called and the close frame is not received from the server, theCloseTask
fires.However, in this case, no
cancelCloseTask
is called, leading to leave the thread from the close timer waiting for a new task.Solution: If
CloseTask
fires, cancel the timer since it is used for a one time scheduling only.As stated in the [
Timer
](https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html#cancel()) Javadoc, it is safe to cancel within the task