Expected Behavior
The ping/pong is enabled to identify the lost connection. For connection to work properly in Android mobile sleep mode, we should be able to disable ping/pong in sleep mode and enable it back again when device wakes up.
Current Behavior
In Android mobile goes to sleep mode, when we disable ping/pong using setConnectionLostTimeout(0). It works fine. But when we enable ping/pong (when device wakes up) using setConnectionLostTimeout(30), it does not work. When we checked, we find that the timer is destroyed on setConnectionLostTimeout(0). We expect it to be created and set on setConnectionLostTimeout(30). But it does not happen. Because of this, we don't have any method of enabling ping/pong once it is disabled.
Expected Solution
Currently disabling the ping/pong by setConnectionLostTimeout(0) is working. Library has to make the necessary changes to ensure ping/pong is enabled back when setConnectionLostTimeout(30) is called.
(or) If Library adds 2 separate methods to enable and disable ping/pong, that will be even better.
.
Steps to Reproduce (for bugs)
- Use the lib to create the android client app
- Connect with websocket server.
- Enable ping/pong in android app
- Set setConnectionLostTimeout(0) in android device sleep mode
- Set setConnectionLostTimeout(30) when android device waked up
- Put android device in sleep mode - the ping/pong disabled due to setConnectionLostTimeout(0)
- Put android in normal mode - the ping/pong didn't enabled event after setConnectionLostTimeout(30). From debug identified the timer is already destroyed.
Debug log (for bugs)
Context
Your Environment
- Java-WebSocket:1.3.7
- Java version: 1.8
- Operating System and version: Android 8.1
- Endpoint Name and version:
- Link to your project:
Expected Behavior
The ping/pong is enabled to identify the lost connection. For connection to work properly in Android mobile sleep mode, we should be able to disable ping/pong in sleep mode and enable it back again when device wakes up.
Current Behavior
In Android mobile goes to sleep mode, when we disable ping/pong using setConnectionLostTimeout(0). It works fine. But when we enable ping/pong (when device wakes up) using setConnectionLostTimeout(30), it does not work. When we checked, we find that the timer is destroyed on setConnectionLostTimeout(0). We expect it to be created and set on setConnectionLostTimeout(30). But it does not happen. Because of this, we don't have any method of enabling ping/pong once it is disabled.
Expected Solution
Currently disabling the ping/pong by setConnectionLostTimeout(0) is working. Library has to make the necessary changes to ensure ping/pong is enabled back when setConnectionLostTimeout(30) is called.
(or) If Library adds 2 separate methods to enable and disable ping/pong, that will be even better.
.
Steps to Reproduce (for bugs)
Debug log (for bugs)
Context
Your Environment