Sending Images over the Chat
Let’s return to the chat feature now one last iteration: enabling users to send and receive images.
Text messages will continue to be sent over the symmetric, negotiated chat channel. But in a return to the short-lived data channels you wrote for the video-filter feature in Applying Filters Remotely with Data Channels, each image a user sends will be delivered over its own asymmetric, short-lived data channel.
Your use of multiple data channels will be invisible to users: images will be appended to the chat log just like text messages are already. But by using one data channel per image, we will avoid congestion on the primary text-chat data channel. It would become a lot less performant for sending text messages ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access