I have a few questions about how node.js keeps socket connections alive (and, conversely, how it can tell if users have gone offline). It looks like there are a few things I still don't understand.

I'm developing a penny auction site, and using node.js to display live updates. It's going pretty well but I found that after a few minutes (5-10) it seems they're no longer connected with the Node server. In some cases just reloading the page will work, in others I have to clear the cache.

Now, I understand that the socket.io.js and nodejs.js files are loaded in hook_init(), which is not run for cached pages. What are the consequences, though? How can I guarantee that users are always connected to Node.js?

Comments

julien66’s picture

Hi,

I never had this problem but I find it interesting. Please keep me updated.
=> You can use the nodejs_checker module : https://drupal.org/project/nodejs_checker to check from the front end if you're still connected or not and improve your understanding of the behavior... (disclamer : I'm the maintener of this module).
I was close to add an "auto-reconnection" feature to it in case the connection was lost and the server still up and running but as I didn't encounter any trouble with this I didn't turn this functionnality on.

Best
++

delacosta456’s picture

Issue summary: View changes

hi
looks to me that i am facing this situation too.. and would like to suggest adding the auto reconnect as an option please..
i have also seen that the refresh does not work when the page is cached with Authcache module am i missing something please ?

thanks