Is DataChannelObserver::OnMessage() chunk size maintained?

36 views
Skip to first unread message

James Inkster

unread,
Jul 28, 2021, 3:07:36 PM7/28/21
to discuss-webrtc
(I'm using native C++...)
I have a datachannel to which I send, say, 1024 bytes of binary data via Send()
I understand that the data is buffered internally on the sending end, but when OnMessage() is called will I get the entire/exact chunk, or could it appear in different sizes?
I need to know whether or not my receiving code needs to implement a parser...

ie., 
Send (1024 bytes) ---> OnMessage (1024 bytes)
OR
Send (1024 bytes) --> OnMessage (512 bytes), OnMessage (512 bytes)

Likewise,
Send (1024 bytes), Send (512 bytes) --> OnMessage (1536 bytes) 
OR
Send (1024 bytes), Send (512 bytes) --> OnMessage (1024), OnMessage (512)

Thanks!

Michael Tüxen

unread,
Jul 28, 2021, 4:57:14 PM7/28/21
to discuss...@googlegroups.com
The data channel should preserve message boundaries.

Best regards
Michael
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/d770098a-59bf-467f-b34b-1b938a30b3a4n%40googlegroups.com.

James Inkster

unread,
Jul 28, 2021, 5:12:43 PM7/28/21
to discuss-webrtc
Thank you!
Reply all
Reply to author
Forward
0 new messages