MCPcopy Index your code
hub / github.com/socketio/socket.io / Manager

Function Manager

client-dist/socket.io.js:4005–4039  ·  view source on GitHub ↗
(uri, opts)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 11

_classCallCheckFunction · 0.85
_typeofFunction · 0.85
installTimerFunctionsFunction · 0.85
_assertThisInitializedFunction · 0.85
reconnectionMethod · 0.80
reconnectionAttemptsMethod · 0.80
reconnectionDelayMethod · 0.80
reconnectionDelayMaxMethod · 0.80
randomizationFactorMethod · 0.80
timeoutMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected