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

Heartbeats not sent if send_buffer is not empty #143

Closed
igm opened this issue Dec 15, 2013 · 1 comment · Fixed by #158
Closed

Heartbeats not sent if send_buffer is not empty #143

igm opened this issue Dec 15, 2013 · 1 comment · Fixed by #158

Comments

@igm
Copy link

igm commented Dec 15, 2013

I'm not sure it's a bug, but anyways I'll ask here as it might be a problem.
From the code it seems that hearbeat timer is not created if send_buffer is not empty:
https://github.com/sockjs/sockjs-node/blob/master/src/transport.coffee#L155

For example if xhr_streaming is used and there's a frame in the buffer then buffer is written to the connection right away, but heartbeats are not sent afterwards as tryFlush does not create the hearbeat timer.

@jcheng5
Copy link
Contributor

jcheng5 commented Jun 6, 2014

I spent most of today trying to figure out a bug we are seeing in @rstudio/shiny-server and it was down to this exact issue. I came here to file an issue on that same line of code.

Here is a minimal repro case:

https://gist.github.com/jcheng5/d7ba5dc2ac4de9bc7aac

jcheng5 added a commit to jcheng5/sockjs-node that referenced this issue Jun 6, 2014
jcheng5 added a commit to rstudio/shiny-server that referenced this issue Jun 6, 2014
Includes b88f9ea, which fixes sockjs/sockjs-node#143. This bug was
causing JJ's ggvis-demo Shiny doc to grey out after about 45 seconds
of inactivity.
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

Successfully merging a pull request may close this issue.

2 participants