|
@@ -133,7 +133,7 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
|
|
|
case 'disconnected':
|
|
|
case 'failed':
|
|
|
util.log('iceConnectionState is disconnected, closing connections to ' + peerId);
|
|
|
- Negotiator.cleanup(connection);
|
|
|
+ connection.close();
|
|
|
break;
|
|
|
case 'completed':
|
|
|
pc.onicecandidate = util.noop;
|
|
@@ -176,8 +176,7 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
|
|
|
}
|
|
|
|
|
|
Negotiator.cleanup = function(connection) {
|
|
|
- connection.close(); // Will fail safely if connection is already closed.
|
|
|
- util.log('Cleanup PeerConnection for ' + connection.peer);
|
|
|
+ util.log('Cleaning up PeerConnection to ' + connection.peer);
|
|
|
|
|
|
var pc = connection.pc;
|
|
|
|