Breaking down a file into chunks

Now that we have a file, we need to get it ready to send to the other user. The easiest approach to this problem is to take the entire file and call our send method with the data. This will take the entire file and give it to the data channel to process as one large message:

Breaking down a file into chunks

Once this happens, the data channel will take the message and try to send all the data through the connection between the clients. Let us say that the user is trying to share their entire music collection, which comes to a size of 50 GB. The data channel will tell the SCTP protocol that it has one message that starts at 0 bytes and ends at our ...

Get Learning WebRTC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.