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

Function Polling

client-dist/socket.io.js:1094–1117  ·  view source on GitHub ↗

* XHR Polling constructor. * * @param {Object} opts * @package

(opts)

Source from the content-addressed store, hash-verified

1092 * @package
1093 */
1094 function Polling(opts) {
1095 var _this;
1096 _classCallCheck(this, Polling);
1097 _this = _super.call(this, opts);
1098 _this.polling = false;
1099 if (typeof location !== "undefined") {
1100 var isSSL = "https:" === location.protocol;
1101 var port = location.port;
1102 // some user agents have empty `location.port`
1103 if (!port) {
1104 port = isSSL ? "443" : "80";
1105 }
1106 _this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
1107 }
1108 /**
1109 * XHR supports binary
1110 */
1111 var forceBase64 = opts && opts.forceBase64;
1112 _this.supportsBinary = hasXHR2 && !forceBase64;
1113 if (_this.opts.withCredentials) {
1114 _this.cookieJar = createCookieJar();
1115 }
1116 return _this;
1117 }
1118 _createClass(Polling, [{
1119 key: "name",
1120 get: function get() {

Callers

nothing calls this directly

Calls 2

_classCallCheckFunction · 0.85
createCookieJarFunction · 0.85

Tested by

no test coverage detected