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 or configuring of websocket's 10-second heartbeat timeout #219

Open
jcheng5 opened this issue Nov 18, 2016 · 1 comment
Open

Comments

@jcheng5
Copy link
Contributor

jcheng5 commented Nov 18, 2016

The websocket transport has a hardcoded 10 second timer:

hto_ref = setTimeout(@heartbeat_cb, 10000)

If the websocket is sending a large message over a slow link to the client, then it may take more than 10 seconds for the heartbeat to actually arrive. A big improvement would be to wait until the heartbeat is actually sent to start the timer, but even then, the client may have large messages it's sending to the server too, which a heartbeat response would be queued behind.

I'm not necessarily asking for a change to the default behavior, but it would be great to be able to disable or configure this timeout, like disconnect_delay for the xhr-based transports.

(If you like I can put together a PR for this, but I wanted to first ask if such a patch would be welcome.)

@brycekahle
Copy link
Contributor

A big improvement would be to wait until the heartbeat is actually sent to start the timer

I don't see a way to register a callback with faye-websocket-node for when this happens.

If you like I can put together a PR for this

I would accept a PR to configure the amount of time to wait for a heartbeat reply.

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

2 participants