fix: close streams on connection close

This commit is contained in:
Jacob Heun 2020-10-15 16:21:42 +02:00
parent 39af3ae7fa
commit d7e113b3db
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F

View File

@ -209,6 +209,8 @@ class Connection {
* @return {Promise<void>}
*/
async close () {
this.streams.map(s => s.close && s.close())
if (this.stat.status === Status.CLOSED) {
return
}