Fix ice candidate gather and extended candidate buffer #166
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.
Description
Pull Request Description: Fix Ice Candidate Gather and Extend Candidate Buffer
Motivation
The current implementation of the WebRTC connection in our project has shown inefficiencies and potential issues related to ICE candidate gathering and processing. Specifically, the existing unbuffered channels for ICE candidates can lead to blocking and delays, negatively impacting the connection setup process. Additionally, some redundant code and potential memory leaks have been identified, which need to be addressed to improve the stability and performance of the WebRTC connections.
Changes and Improvements
Buffered ICE Candidate Channels:
Improved ICE Candidate Handling:
Connection Cleanup Enhancements:
Code Cleanup:
WriteToTrack
function, ensuring proper resource management.Why It Improves the Project
Overall, these changes aim to enhance the performance, stability, and maintainability of the WebRTC connection handling in our project.