* Called upon transport open. * * @private
()
| 391 | * @private |
| 392 | */ |
| 393 | private onopen(): void { |
| 394 | debug(class="st">"open"); |
| 395 | |
| 396 | class="cm">// clear old subs |
| 397 | this.cleanup(); |
| 398 | |
| 399 | class="cm">// mark as open |
| 400 | this._readyState = class="st">"open"; |
| 401 | this.emitReserved(class="st">"open"); |
| 402 | |
| 403 | class="cm">// add new subs |
| 404 | const socket = this.engine; |
| 405 | this.subs.push( |
| 406 | on(socket, class="st">"ping", this.onping.bind(this)), |
| 407 | on(socket, class="st">"data", this.ondata.bind(this)), |
| 408 | on(socket, class="st">"error", this.onerror.bind(this)), |
| 409 | on(socket, class="st">"close", this.onclose.bind(this)), |
| 410 | class="cm">// @ts-ignore |
| 411 | on(this.decoder, class="st">"decoded", this.ondecoded.bind(this)), |
| 412 | ); |
| 413 | } |
| 414 | |
| 415 | /** |
| 416 | * Called upon a ping. |