-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataChannel closes unexpectedly, and without reason #279
Comments
It turns out that I was reading the file too fast, and the WebRTC data channel buffer filled up, which has a limit of 16 megabytes: http://viblast.com/blog/2015/2/25/webrtc-bufferedamount/
|
Oh my god... I encountered exact same problem, with peerJS also and i was unable to find any answer (i had assumption that its some kind-of-buffer related thing), Thank you for an idea finally, i hope this will solve my issue. It is interesting that peerJS have inner mechanism of buffering, which, as i understand, was made right for this problem, HOWEVER the it's implemented seems to rely on catching exception from unable to send, and if in new chrome chunnel is just killed, this system is now redundant. I will make an issue here about it, as soon (if) i will be sure that this is the reason. Edit: yup looks legit, bufferedAmount goes to around 16mb and everything fails. |
Yes, this was a painful bug to uncover. It took me days to finally understand what was happening. PeerJS needs to be updated to properly handle when the data channel buffer overflows, and Chrome kills the connection. |
By the way, if someone will stumble upon this, i opened an issue and posted there a tiny edit to peer.js source to fix that #291 |
Small correction: 16 KB, not 16 MB, for future reference. I faced the same issue. Firefox limit is 16kiB (https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Using_data_channels#Understanding_message_size_limits) around the same. |
I'm experiencing some issues with transferring files using PeerJS... the transfer is chugging along just fine, and then PeerJS just closes the DataChannel, and there's no log of what went wrong. I've turned on debugging for PeerJS, and I'm running PeerServer locally so that I can get debugging logs.
PeerJS logs in Chrome's console:
... the transfer is going well, and then the "DataChannel closed for: abc123_f9pes" line is logged, the connection dies, and the transfer dies.
PeerServer logs in the terminal:
... transfer is going well, and then the 2 "Socket closed" lines are logged, followed by the death of the transfer.
My first question is, why are the "Added ICE candidate for" and "Received ICE candidates for" lines logged several times by PeerJS, and the "CANDIDATE from" lines by PeerServer?
My other question is, why is the connection being killed? It just seems like the socket is being closed... any ideas as to what might be going wrong?
Here's an overview of my environment:
p.s. this problem persists even when running against the cloud hosted PeerServer.
The text was updated successfully, but these errors were encountered: