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

Method _initAdapter

packages/socket.io/lib/namespace.ts:197–204  ·  view source on GitHub ↗

* Initializes the `Adapter` for this nsp. * Run upon changing adapter by `Server#adapter` * in addition to the constructor. * * @private

()

Source from the content-addressed store, hash-verified

195 * @private
196 */
197 _initAdapter(): void {
198 // @ts-ignore
199 this.adapter = new (this.server.adapter()!)(this);
200
201 Promise.resolve(this.adapter.init()).catch((err) => {
202 debug("error while initializing adapter: %s", err);
203 });
204 }
205
206 /**
207 * Registers a middleware, which is a function that gets executed for every incoming {@link Socket}.

Callers 2

constructorMethod · 0.95
adapterMethod · 0.45

Calls 3

debugFunction · 0.85
adapterMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected