(uri, opts)
| 4003 | _inherits(Manager, _Emitter); |
| 4004 | var _super = _createSuper(Manager); |
| 4005 | function Manager(uri, opts) { |
| 4006 | var _this; |
| 4007 | _classCallCheck(this, Manager); |
| 4008 | var _a; |
| 4009 | _this = _super.call(this); |
| 4010 | _this.nsps = {}; |
| 4011 | _this.subs = []; |
| 4012 | if (uri && "object" === _typeof(uri)) { |
| 4013 | opts = uri; |
| 4014 | uri = undefined; |
| 4015 | } |
| 4016 | opts = opts || {}; |
| 4017 | opts.path = opts.path || "/socket.io"; |
| 4018 | _this.opts = opts; |
| 4019 | installTimerFunctions(_assertThisInitialized(_this), opts); |
| 4020 | _this.reconnection(opts.reconnection !== false); |
| 4021 | _this.reconnectionAttempts(opts.reconnectionAttempts || Infinity); |
| 4022 | _this.reconnectionDelay(opts.reconnectionDelay || 1000); |
| 4023 | _this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000); |
| 4024 | _this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5); |
| 4025 | _this.backoff = new Backoff({ |
| 4026 | min: _this.reconnectionDelay(), |
| 4027 | max: _this.reconnectionDelayMax(), |
| 4028 | jitter: _this.randomizationFactor() |
| 4029 | }); |
| 4030 | _this.timeout(null == opts.timeout ? 20000 : opts.timeout); |
| 4031 | _this._readyState = "closed"; |
| 4032 | _this.uri = uri; |
| 4033 | var _parser = opts.parser || parser; |
| 4034 | _this.encoder = new _parser.Encoder(); |
| 4035 | _this.decoder = new _parser.Decoder(); |
| 4036 | _this._autoConnect = opts.autoConnect !== false; |
| 4037 | if (_this._autoConnect) _this.open(); |
| 4038 | return _this; |
| 4039 | } |
| 4040 | _createClass(Manager, [{ |
| 4041 | key: "reconnection", |
| 4042 | value: function reconnection(v) { |
nothing calls this directly
no test coverage detected