Repository navigation
fix: fall back to an available CarPlay control port - #54
Merged
Merged
Conversation
Owner
|
@xiwangly2 感谢贡献! |
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.
当其他服务占用 AirPlay 首选端口(默认 7000)时,原实现直接绑定失败。无线流程会在 RFCOMM/iAP2 启动前退出,有线流程也无法继续发送 CarPlayStartSession,可能表现为 iPhone 无法进入 CarPlay 授权或后续连接。
保留配置端口为首选;遇到 BindException 时,在同一绑定地址上通过端口 0 申请一次系统分配的端口,并保留成功绑定的 socket。失败的候选 socket 会关闭,其他类型错误直接传播。实际监听端口通过 Started.port 返回,统一用于会话配置、Bonjour 及有线/无线 iAP2 StartSession,避免监听与发布端口不一致,也不进行存在竞态的空闲端口预探测。
验证:
实机验证范围为无线 CarPlay;有线 NCM/VPN 连接尚未实机验证。协议编码和 IPv6 监听已由回归覆盖。