Closed tankcong closed 7 years ago
Thanks for the PR but engine.io has the custom ping-pong implementation so we don't need to use ping
of webosocket here. Feel free to reopen if I'm missing something.
From my understanding, engine.io ping/pong is more like a application layer heartbeat, while websocket ping/pong is a kind of transport layer heartbeat. So I think when transport upgrades to websocket, we still need to do ping/pong at websocket layer.
Do you have any bugs or issues related to this ?
Yes I have, Android connection close every double 'pingInterval' seconds , I'm still working on this bug.
@tankcong https://github.com/socketio/engine.io-client-java/issues/72 seems really a basic bug, and I believe it didn't occur before. I wonder the cause of your issue and why this PR fixes it.
Thanks, I will reply here and that closed issue after I get it done. 👍
Turns out that I made a mistake. I use Primus as my server framework. Primus has its own heartbeat strategy, and I missed it. Primus heartbeats and latency.
according to this okhttp-ws issue, the websocket implementation of transport need to call WebsocketCall.sendPing() periodically.