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

Client read TCP timeout when pingTimeout is less than pingInterval #80

Closed
criyle opened this issue Dec 10, 2019 · 0 comments
Closed

Client read TCP timeout when pingTimeout is less than pingInterval #80

criyle opened this issue Dec 10, 2019 · 0 comments

Comments

@criyle
Copy link
Contributor

criyle commented Dec 10, 2019

c.conn.SetReadDeadline(time.Now().Add(c.params.PingTimeout))

According to the JavaScript documentation, a client may have to wait up to pingTimeout + pingInterval ms before getting a disconnect event. https://socket.io/docs/server-api/#new-Server-httpServer-options

My server is written in JavaScript with default parameter (25s pingInterval 5s pingTimeout), this line of code would make all read timeout 5s after receiving pong. This makes my client reconnect every 30s.

For reference, in the JavaScript implementation, it waits pingInterval + pingTimeout:
https://github.com/socketio/engine.io/blob/6a16ea119280a02029618544d44eb515f7f2d076/lib/socket.js#L141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant