Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0935b81

Browse files
committed
Merge pull request socketio#1963 from michael-luo/bugfix/1956
bugfix/1956 test for don't reuse same-namespace connections
2 parents 1b01e16 + afa871b commit 0935b81

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/socket.io.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,23 @@ describe('socket.io', function(){
597597
});
598598
});
599599
});
600+
601+
it('should not reuse same-namespace connections', function(done){
602+
var srv = http();
603+
var sio = io(srv);
604+
var connections = 0;
605+
606+
srv.listen(function() {
607+
var clientSocket1 = client(srv);
608+
var clientSocket2 = client(srv);
609+
sio.on('connection', function() {
610+
connections++;
611+
if(connections === 2) {
612+
done();
613+
}
614+
});
615+
});
616+
});
600617
});
601618

602619
describe('socket', function(){

0 commit comments

Comments
 (0)