Tinder / Scarlet

A Retrofit inspired WebSocket client for Kotlin, Java, and Android
Other
3.2k stars 236 forks source link

Ping is not following the lifecycle #229

Open yumiki opened 9 months ago

yumiki commented 9 months ago

Hi,

There is an issue related to the usage of pingInterval in OkHttpClient. When the WebSocket is closed and this parameter is set, a new socket is promptly opened to perform the next ping. IMHO the ping mechanism should adhere to the lifecycle specified in the Scarlet builder.

To replicate this issue, you can refer to the code provided in the following link and add a lifecycle to the scarlet builder: https://github.com/Tinder/Scarlet/issues/70#issuecomment-482374937