Reader small image

You're reading from  Learning WebRTC

Product typeBook
Published inJun 2015
Reading LevelBeginner
Publisher
ISBN-139781783983667
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Daniel M. Ristic
Daniel M. Ristic
author image
Daniel M. Ristic

Dan Ristic is a frontend engineer and evangelist for Open Web. He strives to push the Web forward with new and creative ideas using the latest technologies. He attended the University of Advancing Technology, Arizona, where he furthered his engineering knowledge and fueled his passion for the Web. He has been writing applications on the Web ever since. He currently lives and works in San Francisco as a senior software engineer at Sony Network Entertainment International. At Sony, he is responsible for managing the frontend application architecture and delivering the PlayStation Store to millions of users. In his free time, he can be found hiking, exploring, working on projects, and attending events.
Read more about Daniel M. Ristic

Right arrow

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:

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 file size, which is 50 GB.

This is where the problems start to arise. If the user is on a bad network connection, the message could fail to send. If we have our data channel setup in a reliable or retry mode, the underlying protocol will simply discard the currently sent data and retry to send the entire message again. This means that both users have...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning WebRTC
Published in: Jun 2015Publisher: ISBN-13: 9781783983667

Author (1)

author image
Daniel M. Ristic

Dan Ristic is a frontend engineer and evangelist for Open Web. He strives to push the Web forward with new and creative ideas using the latest technologies. He attended the University of Advancing Technology, Arizona, where he furthered his engineering knowledge and fueled his passion for the Web. He has been writing applications on the Web ever since. He currently lives and works in San Francisco as a senior software engineer at Sony Network Entertainment International. At Sony, he is responsible for managing the frontend application architecture and delivering the PlayStation Store to millions of users. In his free time, he can be found hiking, exploring, working on projects, and attending events.
Read more about Daniel M. Ristic