pass session to onopen/onclose and ondestroy for consistency
This commit is contained in:
parent
576e08180f
commit
b266f01bf2
6
index.js
6
index.js
|
@ -81,7 +81,7 @@ class Session {
|
||||||
const remote = this._mux._remote[this._remoteId - 1]
|
const remote = this._mux._remote[this._remoteId - 1]
|
||||||
|
|
||||||
this.opened = true
|
this.opened = true
|
||||||
this._track(this.onopen())
|
this._track(this.onopen(this))
|
||||||
|
|
||||||
remote.session = this
|
remote.session = this
|
||||||
if (remote.pending !== null) this._drain(remote)
|
if (remote.pending !== null) this._drain(remote)
|
||||||
|
@ -123,7 +123,7 @@ class Session {
|
||||||
this._localId = 0
|
this._localId = 0
|
||||||
|
|
||||||
this._mux._gc(this._info)
|
this._mux._gc(this._info)
|
||||||
this._track(this.onclose(isRemote))
|
this._track(this.onclose(isRemote, this))
|
||||||
|
|
||||||
if (this._active === 0) this._destroy()
|
if (this._active === 0) this._destroy()
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ class Session {
|
||||||
_destroy () {
|
_destroy () {
|
||||||
if (this.destroyed === true) return
|
if (this.destroyed === true) return
|
||||||
this.destroyed = true
|
this.destroyed = true
|
||||||
this._track(this.ondestroy())
|
this._track(this.ondestroy(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
_recv (type, state) {
|
_recv (type, state) {
|
||||||
|
|
Reference in New Issue