Skip to content

webrtc: a peer connection reports its max message size (for the trystero 0.27.0 port, draft) - #1

Draft
pinhopro wants to merge 1 commit into
mainfrom
trystero/max-message-size
Draft

pinhopro wants to merge 1 commit into
mainfrom
trystero/max-message-size

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

A peer connection reports the largest message its data channels send, as max_message_size(): natively libdatachannel's rtcMaxMessageSize once a remote description is applied, in a page the browser's pc.sctp.maxMessageSize, both within options::max_message_size. The library already read both values to gate its sends; this makes the one value public, so that webcpp::trystero's port to Trystero 0.27.0 decides wide bulk chunks from the transport itself, as Trystero 0.27.0 does, instead of rebuilding it from the SDP (ruling P2-R29 of that port).

Tested natively and with Emscripten (webrtc's own tests). Merges together with webcpporg/trystero#10 and webcpporg/webcpp#51, which hold until webcpp::crypto's API changes land (draft).

…nd, as max_message_size()

basic_peer_connection::max_message_size() is the smaller of
options::max_message_size and the peer's announced limit, the limit each
channel's send checks: natively libdatachannel's rtcGetRemoteMaxMessageSize
once a remote description is applied, in the browser the SCTP transport's
maxMessageSize (Infinity for none) once the connection has one; nothing
before. native_test checks it before negotiation and against real sends
between peers of different limits; browser_backend_test against the fake
transport's sctp, including a refused send at the same limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant