Reconnecting sometimes picks a hub that doesn't exist. #43

Closed
wants to merge 1 commit into
from
Jump to file
+1 −0
Split
View
@@ -42,6 +42,7 @@ exports.connect = function () {
if (s.closed) return;
var hubs = [ { port : port, host : host } ].concat(s.query('seaport'));
+ if (hubs.length <= conIx) conIx = hubs.length - 1;
var c = net.connect.call(null, hubs[conIx].port, hubs[conIx].host);
conIx = (conIx + 1) % hubs.length;