webRTC/webrtc.io-client — pull request #22 by thedracle (2013-01-15 18:06:21+00:00)
Title: Fix hanging connections.

Connections are currently just being removed from the array that contains them, and not closed.

With respect to streaming media, it is important that they be explicitly closed. Not doing so can cause odd issues with netfilter, or other low-level firewalls, which are designed to prevent attacks.

In my case, it was causing consequences for the remote peer, apparently with regards to audio from the local peer not playing when a new PeerConnection is made upon the local peer returning to the room.

This fix explicitly closes the peer connections before removing them.

Testing with this I can leave and rejoin the room multiple times while not losing audio.