Skip to content

Expose asynchronous incoming ICE acceptance and transport cleanup completion - #3

Draft
ziaxzulu wants to merge 12 commits into
upstreamfrom
nxs-dev
Draft

ziaxzulu wants to merge 12 commits into
upstreamfrom
nxs-dev

Conversation

@ziaxzulu

@ziaxzulu ziaxzulu commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Add C and C++ APIs to prepare a peer from a retained incoming ICE request, install callbacks, and then accept it. STUN integrity is verified before peer construction. Applications can also approve another authenticated source tuple for an existing peer without replacing its SDP, DTLS identity or channels.

Contribution Dependency
Stop listeners on their original bind address Corresponding libjuice endpoint behaviour.
Prepare, accept, reject and attach incoming ICE requests libjuice pending-request API.
Observe final ICE/DTLS/SCTP transport destruction Independent lifecycle API; resource-count tests use libjuice statistics.

closeAsync() exposes a shared future or callback; C callers use rtcClosePeerConnectionAsync. Completion follows destruction, including externally retained transport references. Blocking waits wrap asynchronous closure; timeout retains caller ownership. C handles still require deletion after completion.

Rejection and shutdown close prepared peers outside listener locks. Certificate import also runs outside the request mutex. The move-only C++ prepared-peer owner rejects and closes abandoned attempts. In C, a returned peer handle remains caller-owned even when later configuration fails. Existing certificate and ICE configuration APIs are reused, and fingerprint verification remains enabled. Constructor counters are compiled only for tests.

Validation: focused incoming-request and teardown regressions pass, covering reentrant callbacks, scoped ownership, authenticated peer reuse and destruction completion. Coordinated JNI tests exercise real UDP/DTLS/SCTP traffic. Release builds pass with diagnostic exports absent. Incoming API, cleanup contract, source attribution.

This owned aggregate draft keeps upstream as a mirror; independent changes remain candidates for separate external submissions.

Adapted from a2cb59b and ce30eeb. Preserve asynchronous APIs and use the upstream explicit ICE configuration API in the deterministic regression.
Adapted from 5bd6542. Existing upstream C identity and explicit ICE APIs replace the earlier duplicate wrappers.
@ziaxzulu ziaxzulu changed the title Prepare bounded transport teardown and UDP listener ownership Wait for transport cleanup and stop the correct UDP listener Sep 6, 2026
@ziaxzulu ziaxzulu changed the title Wait for transport cleanup and stop the correct UDP listener Accept incoming WebRTC connections and wait for transport cleanup Sep 6, 2026
@ziaxzulu ziaxzulu changed the title Accept incoming WebRTC connections and wait for transport cleanup Expose asynchronous incoming ICE acceptance and transport cleanup completion Sep 8, 2026
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