Aryak,
I thought I had a similar problem as you described in your first post
(concerning REFRESHing html pages) which I solved in a way I described in
my first answer.
However, double checking this I was not able to reproduce it anymore. May
be I was wrong.
The only problem I still can reproduce is that the socket.io client (html
page) establishes a additional second connection (without terminating the
old connection) when it tries to RECONNECT the existing connection. This
happens e.g. in the case that the server is restarted - but not when the
html page is just REFRESHED!
In such a situation I get two "active" connections for one and the same
html client - which causes the problems you described.
However, this can be solved easily by correcting the client script:
Wrong version (produces doubled entries in case of a server restart):
mySocket.on('connect', function()
{
console.log("connected")
mySocket.on("message", function(data){console.log("update watchList
with: "+data)});
});
Correct version:
mySocket.on('connect', function(){console.log("connected")});
mySocket.on("message", function(data){console.log("update watchList
with: "+data)});
Hope this helps.
Matthias
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/04f75129-e717-4016-9262-c5ff488c8b02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.