|
@@ -146,8 +146,12 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
|
|
|
|
|
|
pc.oniceconnectionstatechange = function() {
|
|
|
switch (pc.iceConnectionState) {
|
|
|
- case 'disconnected':
|
|
|
case 'failed':
|
|
|
+ util.log('iceConnectionState is disconnected, closing connections to ' + peerId);
|
|
|
+ connection.emit('error', new Error('Negotiation of connection to ' + peerId + ' failed.'));
|
|
|
+ connection.close();
|
|
|
+ break;
|
|
|
+ case 'disconnected':
|
|
|
util.log('iceConnectionState is disconnected, closing connections to ' + peerId);
|
|
|
connection.close();
|
|
|
break;
|