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

Method socket

packages/socket.io-client/lib/manager.ts:465–475  ·  packages/socket.io-client/lib/manager.ts::Manager.socket

* Creates a new socket for the given `nsp`. * * @return {Socket} * @public

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

Source from the content-addressed store, hash-verified

463 * @public
464 */
465 public socket(nsp: string, opts?: Partial<SocketOptions>): Socket {
466 let socket = this.nsps[nsp];
467 if (!socket) {
468 socket = new Socket(this, nsp, opts);
469 this.nsps[nsp] = socket;
470 } else if (this._autoConnect && !socket.active) {
471 socket.connect();
472 }
473
474 return socket;
475 }
476
477 /**
478 * Called upon a socket close.

Callers 8

index.tsFile · 0.45
index.tsFile · 0.45
lookupFunction · 0.45
connection.tsFile · 0.45
setupManagerCallbacksFunction · 0.45
index.tsFile · 0.45
cluster-adapter.tsFile · 0.45
client.jsFile · 0.45

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected