Skip to content
This repository was archived by the owner on Mar 31, 2021. It is now read-only.

Commit f17227d

Browse files
committed
Some misc changes for the scaffolding
1 parent e7be5ac commit f17227d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var socketio = require('socket.io');
1212

1313
var app = module.exports = express.createServer();
1414
var io = socketio.listen(app);
15+
io.set("log level", 0);
1516

1617
// Configuration
1718

@@ -74,6 +75,7 @@ var pad = function(number, length) {
7475
return str;
7576
}
7677

78+
var numNotStarted = numServers;
7779
var sockets = [];
7880
var logs = [];
7981
var peers = [];
@@ -104,12 +106,16 @@ _.each(_.range(numServers), function(idx) {
104106

105107
io.of("/" + port).on('connection', function (socket) {
106108
sockets[port] = socket;
109+
numNotStarted--;
110+
111+
if (numNotStarted === 0) {
112+
start();
113+
}
107114
});
108115
});
109116

110117
io.sockets.on('connection', function (socket) {
111118
socket.emit("setup", {ports: peers});
112-
start();
113119
});
114120

115121
var start = null;

0 commit comments

Comments
 (0)