It would be nice if a 0 value for pingInterval or pingTimeout could disable ping/pong checking entirely.
When used with an abstraction layer like Primus, the ping/pong is redundant and can sometimes cause situations where engine.io terminates the connection and Primus doesn't pick up on it. In those cases Primus might not reconnect.
@STRML if Primus doesn't pick up those connection terminations it's a bug in Primus so please report that in https://github.com/primus/primus as for the disabling of ping/pong's. I would love to see that as well.
Closed due to inactivity, please reopen if needed.
Maybe it makes sense to reopen as this was a feature request which I also support.
PR is welcome!
If I'm not wrong Engine.IO sends ping messages from client to server. We are currently doing the same in Primus but just FYI we are considering reversing the direction of pings and make the server send them to the client as browsers started to throttle timers. See primus/primus#348 if you are interested.
@lpinca You're right, pings are sent by the client. But a timer is set on both the client and the server (allowing to detect any unavailability from the other side), isn't that the case with primus?
Yes, but the client timer that sends the ping is delayed by the browser so the server incorrectly closes the connection.
Imagine that you used setTimeout(sendPing, 20000); on the client. The sendPing callback is not actually called after 20 sec but after 40 sec.
Hope it makes sense :)