Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add reconnecting event and relevant test #631

wants to merge 5 commits into


None yet
2 participants

poohlty commented Feb 28, 2014

@guille A pull request to make a Manager emits 'reconnecting' event when trying to reconnect. Also a test case is included :)


rauchg commented Mar 1, 2014

@poohlty we need to emit the reconnection events on the sockets, not the manager.


rauchg commented Mar 1, 2014

Aka if you do

var socket1 = io('/a');
var socket2 = io('/b');

And then you lose connection, socket1 should emit reconnecting but socket2 shouldn't.


rauchg commented Mar 1, 2014

Also, there are conflicts that prevent this from being mergeable. Same with the other pull request on socket.io


poohlty commented Mar 2, 2014

Ah, make sense. How do I know when the socket should emit 'reconnecting' though? It seems to me that the reconnecting logic is handled by a manager, which is hidden to a socket?


poohlty commented Mar 9, 2014

@guille do I need more updates on this?

@rauchg rauchg commented on an outdated diff Apr 3, 2014

@@ -44,6 +44,15 @@ describe('connection', function() {
+ it('should emit reconnecting event', function(done) {
+ var socket = io('/a');
+ socket.on('reconnecting', function(){
+ socket.close();
+ done();
+ });
+ socket.io.reconnect();

rauchg Apr 3, 2014


Since this is not public API, i'd rather us test by forcing a disconnetion, and expecting a reconnection.


poohlty commented Apr 4, 2014

@guille Now the test closes the engine rather than calling reconnect :)

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment