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

Method maybeReconnectOnOpen

packages/socket.io-client/lib/manager.ts:299–309  ·  view source on GitHub ↗

* Starts trying to reconnect if reconnection is enabled and we have not * started reconnecting yet * * @private

()

Source from the content-addressed store, hash-verified

297 * @private
298 */
299 private maybeReconnectOnOpen() {
300 // Only try to reconnect if it's the first time we're connecting
301 if (
302 !this._reconnecting &&
303 this._reconnection &&
304 this.backoff.attempts === 0
305 ) {
306 // keeps reconnection from firing twice for the same reconnection loop
307 this.reconnect();
308 }
309 }
310
311 /**
312 * Sets the current transport `socket`.

Callers 1

onErrorMethod · 0.95

Calls 1

reconnectMethod · 0.95

Tested by

no test coverage detected