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

Method subEvents

packages/socket.io-client/lib/socket.ts:313–323  ·  packages/socket.io-client/lib/socket.ts::Socket.subEvents

* Subscribe to open, close and packet events * * @private

()

Source from the content-addressed store, hash-verified

311 * @private
312 */
313 private subEvents(): void {
314 if (this.subs) return;
315
316 const io = this.io;
317 this.subs = [
318 on(io, class="st">"open", this.onopen.bind(this)),
319 on(io, class="st">"packet", this.onpacket.bind(this)),
320 on(io, class="st">"error", this.onerror.bind(this)),
321 on(io, class="st">"close", this.onclose.bind(this)),
322 ];
323 }
324
325 /**
326 * Whether the Socket will try to reconnect when its Manager connects or reconnects.

Callers 1

connectMethod · 0.95

Calls 2

onFunction · 0.90
bindMethod · 0.80

Tested by

no test coverage detected