Skip to content
Browse files

Reconnecting sometimes picks a hub that doesn't exist.

I've gotten these errors periodically and this should resolve them.

/Path/to/project/node_modules/seaport/index.js:45
        var c = net.connect.call(null, hubs[conIx].port, hubs[conIx].host);
                                                  ^
TypeError: Cannot read property 'port' of undefined
    at reconnect [as _onTimeout] (/Path/to/project/node_modules/seaport/index.js:45:51)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
  • Loading branch information...
1 parent a1dc076 commit ccf425d6bca03cf9a5b797745f86b5a93c118925 @cheddar committed Oct 21, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 index.js
View
1 index.js
@@ -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;

0 comments on commit ccf425d

Please sign in to comment.
Something went wrong with that request. Please try again.