*need to use _mux on Channel calls to syncState
This commit is contained in:
parent
5907966d77
commit
d7dede7894
8
index.js
8
index.js
|
@ -81,7 +81,7 @@ class Channel {
|
||||||
if (this._handshake) this._handshake.encode(state, handshake);
|
if (this._handshake) this._handshake.encode(state, handshake);
|
||||||
|
|
||||||
this._mux._write0(state.buffer);
|
this._mux._write0(state.buffer);
|
||||||
await this.syncState?.();
|
await this._mux.syncState?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
_dec() {
|
_dec() {
|
||||||
|
@ -96,7 +96,7 @@ class Channel {
|
||||||
async _fullyOpenSoon() {
|
async _fullyOpenSoon() {
|
||||||
this._mux._remote[this._remoteId - 1].session = this;
|
this._mux._remote[this._remoteId - 1].session = this;
|
||||||
queueTick(this._fullyOpen.bind(this));
|
queueTick(this._fullyOpen.bind(this));
|
||||||
await this.syncState?.();
|
await this._mux.syncState?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
_fullyOpen() {
|
_fullyOpen() {
|
||||||
|
@ -154,7 +154,7 @@ class Channel {
|
||||||
this._track(this.onclose(isRemote, this));
|
this._track(this.onclose(isRemote, this));
|
||||||
|
|
||||||
if (this._active === 0) this._destroy();
|
if (this._active === 0) this._destroy();
|
||||||
await this.syncState?.();
|
await this._mux.syncState?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
_destroy() {
|
_destroy() {
|
||||||
|
@ -190,7 +190,7 @@ class Channel {
|
||||||
state.buffer[1] = 3;
|
state.buffer[1] = 3;
|
||||||
c.uint.encode(state, this._localId);
|
c.uint.encode(state, this._localId);
|
||||||
|
|
||||||
await this._close(false);
|
await this._mux._close(false);
|
||||||
this._mux._write0(state.buffer);
|
this._mux._write0(state.buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue