File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ module.exports = function (signalhost, opts) {
149149 var expectedLocalStreams = parseInt ( ( opts || { } ) . expectedLocalStreams , 10 ) || 0 ;
150150 var announceTimer = 0 ;
151151 var updateTimer = 0 ;
152+ var CLOSED_STATES = [ 'failed' , 'closed' ] ;
152153
153154 function checkReadyToAnnounce ( ) {
154155 clearTimeout ( announceTimer ) ;
@@ -402,9 +403,10 @@ module.exports = function (signalhost, opts) {
402403 if ( channel . readyState === 'open' ) {
403404 channelReady ( ) ;
404405 }
405- // If the underlying connection has failed/closed, then terminate the monitor
406- else if ( [ 'failed' , 'closed' ] . indexOf ( pc . iceConnectionState ) !== - 1 ) {
407- debug ( 'connection has terminated, cancelling channel monitor' ) ;
406+ // If the underlying connection has failed/closed, or if the ready state of the channel has transitioned to a closure
407+ // state, then terminate the monitor
408+ else if ( CLOSED_STATES . indexOf ( pc . iceConnectionState ) !== - 1 || CLOSED_STATES . indexOf ( channel . readyState ) !== - 1 ) {
409+ debug ( 'connection or channel has terminated, cancelling channel monitor' ) ;
408410 clearInterval ( channelMonitor ) ;
409411 clearTimeout ( channelConnectionTimer ) ;
410412 }
Original file line number Diff line number Diff line change 4242 "grunt-browserify" : " ^3.4.0" ,
4343 "grunt-contrib-uglify" : " ^0.9.1" ,
4444 "grunt-contrib-watch" : " ^0.6.1" ,
45+ "hosted-git-info" : " 2.5.0" ,
4546 "rtc-bufferedchannel" : " ^0.5.0" ,
4647 "rtc-captureconfig" : " ^2.1.0" ,
4748 "rtc-filter-grayscale" : " ~0.1.0" ,
5556 "uuid" : " ^2.0.1" ,
5657 "whisk" : " ^1.0.0"
5758 }
58- }
59+ }
You can’t perform that action at this time.
0 commit comments