* Called by `Namespace` upon successful * middleware execution (ie: authorization). * Socket is added to namespace array before * call to join, so adapters can access it. * * @private
()
| 506 | * @private |
| 507 | */ |
| 508 | _onconnect(): void { |
| 509 | debug("socket connected - writing packet"); |
| 510 | this.connected = true; |
| 511 | this.join(this.id); |
| 512 | if (this.conn.protocol === 3) { |
| 513 | this.packet({ type: PacketType.CONNECT }); |
| 514 | } else { |
| 515 | this.packet({ |
| 516 | type: PacketType.CONNECT, |
| 517 | data: { sid: this.id, pid: this.pid }, |
| 518 | }); |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | /** |
| 523 | * Called with each packet. Called by `Client`. |
no test coverage detected