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

Method _remove

packages/socket.io/lib/client.ts:188–198  ·  view source on GitHub ↗

* Removes a socket. Called by each `Socket`. * * @private

(
    socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>,
  )

Source from the content-addressed store, hash-verified

186 * @private
187 */
188 _remove(
189 socket: Socket<ListenEvents, EmitEvents, ServerSideEvents, SocketData>,
190 ): void {
191 if (this.sockets.has(socket.id)) {
192 const nsp = this.sockets.get(socket.id)!.nsp.name;
193 this.sockets.delete(socket.id);
194 this.nsps.delete(nsp);
195 } else {
196 debug("ignoring remove for %s", socket.id);
197 }
198 }
199
200 /**
201 * Closes the underlying connection.

Callers 2

_oncloseMethod · 0.45
_cleanupMethod · 0.45

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected