mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-28 22:42:18 +00:00
fix: close streams on connection close
This commit is contained in:
parent
39af3ae7fa
commit
d7e113b3db
@ -209,6 +209,8 @@ class Connection {
|
|||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async close () {
|
async close () {
|
||||||
|
this.streams.map(s => s.close && s.close())
|
||||||
|
|
||||||
if (this.stat.status === Status.CLOSED) {
|
if (this.stat.status === Status.CLOSED) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user