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

Why on('connection', ...) gets called twice (client side)? #350

Closed
mikaelkundert opened this issue Jul 6, 2011 · 6 comments
Closed

Why on('connection', ...) gets called twice (client side)? #350

mikaelkundert opened this issue Jul 6, 2011 · 6 comments

Comments

@mikaelkundert
Copy link

I just can't get why I get two messages in my console when using namespaces.

In this example (client side) I get two connect messages in console:

var server = io.connect('http://localhost:8080/namespace');
server('connect', function() {
  console.log('Connect');
});

This example I get only once:

var server = io.connect('http://localhost:8080');
server('connect', function() {
  console.log('Connect');
});
@3rd-Eden
Copy link
Contributor

3rd-Eden commented Jul 6, 2011

Version are you using?

@mikaelkundert
Copy link
Author

First npm install was 29th of June and just before posting this issue I did npm update on socket.io, so I guess the latest one?

@3rd-Eden
Copy link
Contributor

3rd-Eden commented Jul 6, 2011

It was a bug in 0.7.5 < but we fixed it in the latest version, 0.7.6. Can you post the output of your npm ls ? This will show which version are installed for your project.

On Jul 6, 2011, at 7:18 PM, mikaelkundert wrote:

First npm install was 29th of June and just before posting this issue I did npm update on socket.io, so I guess the latest one?

Reply to this email directly or view it on GitHub:
#350 (comment)

@mikaelkundert
Copy link
Author

Sure, here you go:

socket.io@0.7.6 /.../node_modules/socket.io
├── policyfile@0.0.3 
├── redis@0.6.0 
└── socket.io-client@0.7.3

I tried going from that path to node_modules/socket.io-client and run command npm update with no respond..

@3rd-Eden
Copy link
Contributor

3rd-Eden commented Jul 7, 2011

@guille

Unable to reproduce using test suite: https://github.com/LearnBoost/socket.io-client/pull/224/files (see test suite files)
It has different ways of connecting to namespaces, connections are counted and messages are counted. They both result in 3.

@mikaelkundert
Copy link
Author

Hi! My client JS was out-dated, I forgot to update the file after updating socket.io.

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