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

Method connect

packages/socket.io-client/lib/socket.ts:356–363  ·  packages/socket.io-client/lib/socket.ts::Socket.connect

* "Opens" the socket. * * @example * const socket = io({ * autoConnect: false * }); * * socket.connect();

()

Source from the content-addressed store, hash-verified

354 * socket.connect();
355 */
356 public connect(): this {
357 if (this.connected) return this;
358
359 this.subEvents();
360 if (!this.io[class="st">"_reconnecting"]) this.io.open(); class="cm">// ensure open
361 if (class="st">"open" === this.io._readyState) this.onopen();
362 return this;
363 }
364
365 /**
366 * Alias for {@link connect()}.

Callers 6

openMethod · 0.95
socket.tsFile · 0.45
connection.tsFile · 0.45
retry.tsFile · 0.45
initRedisClientFunction · 0.45
redis.tsFile · 0.45

Calls 3

subEventsMethod · 0.95
onopenMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected