I'm trying to send a file in chunks over WebRTC, and I'm wondering if I can create a callback function to be called after RTCDataChannel.send()
finishes sending each chunk of the file.
Is RTCDataChannel.send()
a synchronous/blocking call? If so, my callback can be executed on the line after .send()
.
If .send()
is asynchronous/non-blocking, then this will get tricky since it doesn't seem like .send()
accepts a callback function, and I want to avoid using a buffer and a timeout.