From d7dede78946d1aed26607ae1550dc6aa80d6bcbd Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 5 Apr 2023 20:03:12 -0400 Subject: [PATCH] *need to use _mux on Channel calls to syncState --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 20879cb..e9c3022 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ class Channel { if (this._handshake) this._handshake.encode(state, handshake); this._mux._write0(state.buffer); - await this.syncState?.(); + await this._mux.syncState?.(); } _dec() { @@ -96,7 +96,7 @@ class Channel { async _fullyOpenSoon() { this._mux._remote[this._remoteId - 1].session = this; queueTick(this._fullyOpen.bind(this)); - await this.syncState?.(); + await this._mux.syncState?.(); } _fullyOpen() { @@ -154,7 +154,7 @@ class Channel { this._track(this.onclose(isRemote, this)); if (this._active === 0) this._destroy(); - await this.syncState?.(); + await this._mux.syncState?.(); } _destroy() { @@ -190,7 +190,7 @@ class Channel { state.buffer[1] = 3; c.uint.encode(state, this._localId); - await this._close(false); + await this._mux._close(false); this._mux._write0(state.buffer); }