Skip to content

feat(mac): optimize connection reliability, auto-connect flow, and server thread-safety#238

Draft
Mudit200408 wants to merge 1 commit into
sameerasw:developfrom
Mudit200408:test-con
Draft

feat(mac): optimize connection reliability, auto-connect flow, and server thread-safety#238
Mudit200408 wants to merge 1 commit into
sameerasw:developfrom
Mudit200408:test-con

Conversation

@Mudit200408
Copy link
Copy Markdown
Contributor

  • Improve auto-connect reliability and tracking via QuickConnectManager and UDPDiscoveryManager.
  • Optimize network change transition: immediately stop the server and reset the connection status to Disconnected, delaying only the server restart by 5 seconds to let interfaces stabilize.
  • Introduce a 6-second reconnect grace timer for temporary socket drops to coordinate with Android watchdog and prevent spurious UI disconnects.
  • Refactor server termination to safely capture active servers under lock before stopping them, preventing concurrent modification crashes.
  • Offload server stop/start cycles during restart to a background utility queue to keep the main thread responsive.
  • Fix UDP broadcast target address to 255.255.255.255 for reliable wakeup discovery.
  • Revert transient wake-up retry and filtering logic, reverting commit 1ce9ac6.

Needs Android side changes!!

…rver thread-safety

- Improve auto-connect reliability and tracking via QuickConnectManager and UDPDiscoveryManager.
- Optimize network change transition: immediately stop the server and reset the connection status to Disconnected, delaying only the server restart by 5 seconds to let interfaces stabilize.
- Introduce a 6-second reconnect grace timer for temporary socket drops to coordinate with Android watchdog and prevent spurious UI disconnects.
- Refactor server termination to safely capture active servers under lock before stopping them, preventing concurrent modification crashes.
- Offload server stop/start cycles during restart to a background utility queue to keep the main thread responsive.
- Fix UDP broadcast target address to 255.255.255.255 for reliable wakeup discovery.
- Revert transient wake-up retry and filtering logic, reverting commit 1ce9ac6.
@sameerasw
Copy link
Copy Markdown
Owner

@Mudit200408 This PR may need more works as I have found a couple of major bugs one including not being able to disconnect at all. And also discovery service continuing while the connectionw as established and more. Please take a look and address them. :)

sameerasw/airsync-android#110 as well

@sameerasw
Copy link
Copy Markdown
Owner

CleanShot-Xcode-AirSync — BLECentralManager swift-20260521-12  07 35@2x

Even started connecting to my old Pixel 6A which is of a family member I used a while back to test. Not even on the latest. So I guess this has some good things going on with it. Just need some fixes :)

@Mudit200408
Copy link
Copy Markdown
Contributor Author

@Mudit200408 This PR may need more works as I have found a couple of major bugs one including not being able to disconnect at all. And also discovery service continuing while the connectionw as established and more. Please take a look and address them. :)

sameerasw/airsync-android#110 as well

Sure, Already fixed the 2 issues but i cannot get the BLE to connect, will fix that one soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants