* 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
()
| 599 | * @private |
| 600 | */ |
| 601 | _onconnect(): void { |
| 602 | debug("socket connected - writing packet"); |
| 603 | this.connected = true; |
| 604 | this.join(this.id); |
| 605 | if (this.conn.protocol === 3) { |
| 606 | this.packet({ type: PacketType.CONNECT }); |
| 607 | } else { |
| 608 | this.packet({ |
| 609 | type: PacketType.CONNECT, |
| 610 | data: { sid: this.id, pid: this.pid }, |
| 611 | }); |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | /** |
| 616 | * Called with each packet. Called by `Client`. |
no test coverage detected