socketio / engine.io-client-java

Engine.IO Client Library for Java
http://socketio.github.io/engine.io-client-java
Other
360 stars 167 forks source link

add websocket transport ping. #75

Closed tankcong closed 7 years ago

tankcong commented 7 years ago

according to this okhttp-ws issue, the websocket implementation of transport need to call WebsocketCall.sendPing() periodically.

nkzawa commented 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.

tankcong commented 7 years ago

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.

nkzawa commented 7 years ago

Do you have any bugs or issues related to this ?

tankcong commented 7 years ago

Yes I have, Android connection close every double 'pingInterval' seconds , I'm still working on this bug.

nkzawa commented 7 years ago

@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.

tankcong commented 7 years ago

Thanks, I will reply here and that closed issue after I get it done. 👍

tankcong commented 7 years ago

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.