-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data channel messages slicing #82
Conversation
Codecov Report
@@ Coverage Diff @@
## master #82 +/- ##
=======================================
Coverage 77.16% 77.16%
=======================================
Files 20 20
Lines 635 635
Branches 73 73
=======================================
Hits 490 490
Misses 116 116
Partials 29 29
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perfect. I only request that you look at changing the class names to avoid conflicts or confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR implements data chunking, issue #78
Data is sent as ArrayBuffer, with small header containing message id, number of chunks and chunk number. On receiver side, chunks are stitched together.
There're number of constants that control sending process:
Outgoing buffer is where data is buffered after channel.send() but before it is actually sent. When buffer fills up to WEBRTC_DATACHANNEL_MAX_BUFFER, we stop sending and wait for lowbuffer event from the data channel. If event doesn't occur within WEBRTC_DATACHANNEL_BUFFER_TIMEOUT, we re-try checking current buffer size. If the buffer is still larger than WEBRTC_DATACHANNEL_MAX_BUFFER after checking for WEBRTC_DATACHANNEL_MAX_BUFFER_TIMEOUTS times, we consider this to be send error.
I've tested sending 150MB between FF and Chrome located on different remote machines connected via public internet.