Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling ping/pong? #5082

Open
STRML opened this issue Mar 5, 2015 · 9 comments
Open

Allow disabling ping/pong? #5082

STRML opened this issue Mar 5, 2015 · 9 comments
Labels
package:engine.io This concerns the "engine.io" package

Comments

@STRML
Copy link

STRML commented Mar 5, 2015

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.

@3rd-Eden
Copy link
Contributor

3rd-Eden commented Mar 6, 2015

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

@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

@lpinca
Copy link
Contributor

lpinca commented Jan 22, 2017

Maybe it makes sense to reopen as this was a feature request which I also support.

@darrachequesne
Copy link
Member

PR is welcome!

@lpinca
Copy link
Contributor

lpinca commented Jan 22, 2017

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

@darrachequesne
Copy link
Member

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

@lpinca
Copy link
Contributor

lpinca commented Jan 22, 2017

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 :)

@STRML
Copy link
Author

STRML commented Jan 22, 2017 via email

@darrachequesne darrachequesne mentioned this issue May 17, 2018
9 tasks
darrachequesne referenced this issue in socketio/engine.io Feb 3, 2020
The ping packets will now be sent by the server, because the timers set in the browsers are not
reliable enough. We suspect that a lot of timeout problems came from timer being delayed on the
client-side.

Breaking change: v3.x clients will not be able to connect anymore (they will send a ping packet and
timeout while waiting for a pong packet)

Related: https://github.com/socketio/engine.io/issues/312
darrachequesne referenced this issue in socketio/engine.io-client Feb 3, 2020
The ping packets will now be sent by the server, because the timers set in the browsers are not
reliable enough. We suspect that a lot of timeout problems came from timer being delayed on the
client-side.

Breaking change: v3.x clients will not be able to connect anymore (they will send a ping packet and
timeout while waiting for a pong packet)

Related: https://github.com/socketio/engine.io/issues/312
darrachequesne referenced this issue in socketio/engine.io-client Feb 4, 2020
The ping packets will now be sent by the server, because the timers set
in the browsers are not reliable enough. We suspect that a lot of
timeout problems came from timers being delayed on the client-side.

Breaking change: v3.x clients will not be able to connect anymore (they
will send a ping packet and timeout while waiting for a pong packet).

Related: https://github.com/socketio/engine.io/issues/312
darrachequesne referenced this issue in socketio/engine.io Feb 4, 2020
The ping packets will now be sent by the server, because the timers set
in the browsers are not reliable enough. We suspect that a lot of
timeout problems came from timers being delayed on the client-side.

Breaking change: v3.x clients will not be able to connect anymore (they
will send a ping packet and timeout while waiting for a pong packet).

Related: https://github.com/socketio/engine.io/issues/312
@haneenmahd
Copy link

Following up on this issue, as of commit 31ff875 it has reversed the ping-pong mechanism. So, is this issue still relevant?

@darrachequesne darrachequesne added the package:engine.io This concerns the "engine.io" package label Jul 9, 2024
@darrachequesne darrachequesne transferred this issue from socketio/engine.io Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine.io This concerns the "engine.io" package
Projects
None yet
Development

No branches or pull requests

5 participants