I am working on an application that implements several different features using WebRTC for peer-to-peer communication between an ElectronJS app and a UWP app (using the Org.WebRTC UWP Nuget), including real-time audio/video streaming of both webcam feeds and screen/window captures (using the desktopCapture API), as well as several RTCDataChannels for a few different purposes. Everything 'works', but I have a quality-of-life issue that I don't understand, and I can't find any advice regarding this specific issue.
I have everything set up and functioning, but at one point I send a fairly large amount of data (~10mb) over a reliable, ordered RTCDataChannel, and (with no predictability I can identify) sometimes there is a delay of five to ten seconds before that data starts arriving on the other end. The data is both strings and binary messages interleaved together, where the binary messages are all <= 64kb large.
In those instances where the delay happens, immediately upon finishing all of the send calls, the iceconnectionstate for the RTCPeerConnection changes from "complete" to either "connected" or (rarely) "disconnected", then eventually back to "complete", suggesting some part of the connection is broken and reestablished, hence the delay. But I can't figure out what is causing the issue or how to fix it, and it is preventing completion of a required feature for the app I am working on.
Any advice or insight would be greatly appreciated. I use google groups like this often for finding already answered questions, but I don't post questions, so apologies for any inadvertent breaches of etiquette. Please let me know if there is any additional info I can provide that would help in answering my question.
Thanks!
I have tried a few approaches, including queuing up sends and dispatching them in the onbufferamountlow event callback, if that is what you mean. But I'm not exactly certain I've used that callback correctly, and it doesn't get called in the state I expect. If I set the buffer threshold to N, and print out the buffered amount inside of that callback before I send anything new, it is sometimes higher than N, which doesn't make sense to me. I've had trouble finding good examples of using that callback correctly. I'm not doing any other checks before I send inside that callback; should I be?
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/EjevtDTsxuE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/62379198-4bdc-4faf-948b-b732fd1966c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I just took a look in easyrtc to see how we did it there. There, we used a sliding window approach: the receiver had to send an ack every some many packets or we'd stop sending until we received one. At the time, the buffer checking method didn't exist, though I seem to recall using some place else once.
You might try checking out the file sharing demo a https://demo.easyrtc.com/demos/demo_data_channel_filesharing.html to see if it has the same issues. If it does not, then you could possibly adapt the easyrtc_ft.js code (where all the file sharing over data channel logic is) to fit your own data structures.
On Mon, Jun 4, 2018 at 5:31 PM, <tyler...@gmail.com> wrote:
I have tried a few approaches, including queuing up sends and dispatching them in the onbufferamountlow event callback, if that is what you mean. But I'm not exactly certain I've used that callback correctly, and it doesn't get called in the state I expect. If I set the buffer threshold to N, and print out the buffered amount inside of that callback before I send anything new, it is sometimes higher than N, which doesn't make sense to me. I've had trouble finding good examples of using that callback correctly. I'm not doing any other checks before I send inside that callback; should I be?
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/EjevtDTsxuE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/62379198-4bdc-4faf-948b-b732fd1966c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ThebufferedAmountLowThreshold
attribute sets the threshold at which theis considered to be low. When the
bufferedAmount
decreases from above this threshold to equal or below it, the
bufferedAmount
event fires. The
bufferedamountlow
is initially zero on each new
bufferedAmountLowThreshold
, but the application may change its value at any time.
RTCDataChannel