onclose and onerror not getting called on DataChannel disconnect

Posted by Will on Stack Overflow See other posts from Stack Overflow or by Will
Published on 2013-06-29T04:49:23Z Indexed on 2013/06/29 10:21 UTC
Read the original article Hit count: 169

Filed under:
|

I have a wall application using WebRTC DataChannels. In the code I've managed to work out the connection, but I'm not getting notified when a peer disconnects. On the channels I have the following listeners:

channels[uid].onerror = function( event ) {
  console.log( 'channels[uid].onerror', uid, arguments )
  removePeer( uid )
}

channels[uid].onclose = function() {
  console.log( 'channels[uid].onclose', uid, arguments )
  removePeer( uid )
}

When I reload tabs disconnecting peers, I don't get close messages. When I send to them, I don't get an error.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about webrtc