Add asynchronous data channel sends and bridge the ICE selected candidate pair#3
Open
SendableMetatype wants to merge 2 commits into
Open
Conversation
Send is a blocking proxy call that stalls the caller on the native network thread until the send is processed. sendAsync posts instead, copying the payload out before returning so callers can reuse their buffers immediately. For direct buffers only the bytes between position and limit are sent. Queueing failures are logged natively and fatal errors surface through the data channel observer as a state change.
Exposes the remote address of the ICE nominated candidate pair. The callback fires before DTLS, SCTP, and the data channels open, so consumers can attach the real remote transport address to a connection before it becomes active. Backward compatible default method; existing observers are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two additions from running webrtc-java as the data channel transport of a Geyser based Bedrock proxy in production.
sendAsync on RTCDataChannel. Send is a blocking proxy call that stalls the caller on the native network thread until the send is processed. Under load, with every game packet of every player crossing that call, all senders serialize on one thread. sendAsync posts instead and copies the payload out before returning, so callers can reuse their buffers immediately. For direct buffers only the bytes between position and limit are sent. Queueing failures are logged natively and fatal errors surface through the data channel observer as a state change.
OnIceSelectedCandidatePairChanged bridge. libwebrtc reports the nominated candidate pair before DTLS and SCTP come up, which is the only clean moment to learn a connection's real remote transport address (the getStats route is async and lands after activation). Exposed as a backward compatible default method on PeerConnectionObserver carrying the remote candidate's ip, port, and candidate type. Field access follows the Android SDK bridge (event.selected_candidate_pair.remote_candidate()).
Both are running in production on the linux x86_64 native; all platforms build and the existing test suites pass on my fork's CI.