Ports remain occupied in WebRTC After Peer Disconnection

Hello, I have used the code given here to create the webrtc application. The issue with this application is that the ports remains occupied even if we close the live view is closed or peers are disconnected.
Could anyone help me understand:
Why WebRTC keeps the ports occupied after disconnection?
If there’s a way to explicitly release the port sooner?

Does anyone know why this happens or have tips on managing WebRTC port usage so they release more quickly after a disconnect? Any advice or best practices would be super helpful!

Thanks in Advance!

The last time this came up was due to a reference counting issue in the application causing resources to still be alive. My suggestion would therefore be, ensure your application is leak free.