主动关闭信道
This commit is contained in:
parent
5a34c586ca
commit
1acb6f9f6b
|
@ -51,6 +51,7 @@
|
||||||
if (buffer.byteLength >= item.size) {
|
if (buffer.byteLength >= item.size) {
|
||||||
console.log('音乐数据接收完毕')
|
console.log('音乐数据接收完毕')
|
||||||
item.arrayBuffer = buffer
|
item.arrayBuffer = buffer
|
||||||
|
event.target.close() // 关闭信道
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,6 +133,7 @@
|
||||||
}
|
}
|
||||||
await sendChunk(ch, item.arrayBuffer)
|
await sendChunk(ch, item.arrayBuffer)
|
||||||
console.log(`发送 ${channel} 信道数据结束`)
|
console.log(`发送 ${channel} 信道数据结束`)
|
||||||
|
ch.close() // 关闭信道
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue