Refactor transportclose 16

This commit is contained in:
Sergiu Toma 2022-08-11 22:11:49 +03:00
parent f6e3203198
commit 3473c10608

7
app.js
View File

@ -158,9 +158,10 @@ peers.on('connection', async socket => {
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`)
producer.on('transportclose', () => {
console.log('transport for this producer closed ')
console.log('transport for this producer closed', callId)
// closeRoom(callId)
producer.close()
router[callId].close()
delete router[callId]
})
@ -197,7 +198,9 @@ peers.on('connection', async socket => {
})
consumer.on('producerclose', () => {
console.log('producer of consumer closed')
console.log('producer of consumer closed', callId)
router[callId].close()
delete router[callId]
})
// from the consumer extract the following params