This commit is contained in:
Michelle Bu 2014-02-03 19:25:53 -08:00
parent 82a3e47dcc
commit 766442d281

View File

@ -78,9 +78,6 @@ PeerServer.prototype._initializeWSS = function() {
self._clients[key][id] = { token: token, ip: ip };
self._ips[ip]++;
socket.send(JSON.stringify({ type: 'OPEN' }));
// We're going to emit here, because for XHR we don't *know* when someone
// disconnects.
self.emit('connection', id);
}
self._configureWS(socket, key, id, token);
} else {
@ -141,6 +138,10 @@ PeerServer.prototype._configureWS = function(socket, key, id, token) {
throw e;
}
});
// We're going to emit here, because for XHR we don't *know* when someone
// disconnects.
this.emit('connection', id);
};