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

Method destroy

packages/socket.io-client/lib/socket.ts:874–881  ·  packages/socket.io-client/lib/socket.ts::Socket.destroy

* Called upon forced client/server side disconnections, * this method ensures the manager stops tracking us and * that reconnections don't get triggered for this. * * @private

()

Source from the content-addressed store, hash-verified

872 * @private
873 */
874 private destroy(): void {
875 if (this.subs) {
876 class="cm">// clean subscriptions to avoid reconnections
877 this.subs.forEach((subDestroy) => subDestroy());
878 this.subs = undefined;
879 }
880 this.io[class="st">"_destroy"](this);
881 }
882
883 /**
884 * Disconnects the socket manually. In that case, the socket will not try to reconnect.

Callers 4

onpacketMethod · 0.95
ondisconnectMethod · 0.95
disconnectMethod · 0.95
cleanupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected