From 3473c106086c1e32270fdf1cc452d4b607e5ade3 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Thu, 11 Aug 2022 22:11:49 +0300 Subject: [PATCH] Refactor transportclose 16 --- app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 189bbec..3253a26 100644 --- a/app.js +++ b/app.js @@ -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