MCPcopy
hub / github.com/socketio/socket.io / constructor

Method constructor

packages/socket.io-client/lib/socket.ts:279–288  ·  view source on GitHub ↗

* `Socket` constructor.

(io: Manager, nsp: string, opts?: Partial<SocketOptions>)

Source from the content-addressed store, hash-verified

277 * `Socket` constructor.
278 */
279 constructor(io: Manager, nsp: string, opts?: Partial<SocketOptions>) {
280 super();
281 this.io = io;
282 this.nsp = nsp;
283 if (opts && opts.auth) {
284 this.auth = opts.auth;
285 }
286 this._opts = Object.assign({}, opts);
287 if (this.io._autoConnect) this.open();
288 }
289
290 /**
291 * Whether the socket is currently disconnected

Callers

nothing calls this directly

Calls 1

openMethod · 0.95

Tested by

no test coverage detected