3 const Namespace = require('./namespace');
7 class ParentNamespace extends Namespace {
10 super(server, '/_' + (count++));
11 this.children = new Set();
17 const args = Array.prototype.slice.call(arguments);
19 this.children.forEach(nsp => {
20 nsp.rooms = this.rooms;
21 nsp.flags = this.flags;
22 nsp.emit.apply(nsp, args);
29 const namespace = new Namespace(this.server, name);
30 namespace.fns = this.fns.slice(0);
31 this.listeners('connect').forEach(listener => namespace.on('connect', listener));
32 this.listeners('connection').forEach(listener => namespace.on('connection', listener));
33 this.children.add(namespace);
34 this.server.nsps[name] = namespace;
39 module.exports = ParentNamespace;