Repository navigation
fix(ble): drive the Windows BLE receiver from events instead of a 50 … - #88
Merged
Merged
Conversation
…ms loop The thread that owns the GATT objects now sleeps until something changes: a message to send, an indication completing, a session ending, the advertisement status or subscribers changing, a BLE send starting or ending, visibility, or cancel. The 50 ms tick also capped outbound at about 20 indications a second; the next packet now goes as soon as the last is confirmed. The fixed waits go with it. The recycle waits for the phone to leave the link instead of sleeping 500 ms, with a 2 s limit standing in for that event in case Windows keeps a client. The drain before the switch takes what the duplex already holds instead of waiting 200 ms for more (Linux too). The 5 s limit on each indication is replaced by the switch it stood in for: once a session moves to its upgraded socket, its remaining packets go out without waiting on confirmations the phone has stopped sending. The 3 s and 10 s drain limits now end on the link dropping, the 45 s first-byte limit is gone (the phone closing the socket ends the copy), and the ConnectionConfirm retries end with the session instead of after 5. Closes #60
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.
…ms loop
The thread that owns the GATT objects now sleeps until something changes: a message to send, an indication completing, a session ending, the advertisement status or subscribers changing, a BLE send starting or ending, visibility, or cancel. The 50 ms tick also capped outbound at about 20 indications a second; the next packet now goes as soon as the last is confirmed.
The fixed waits go with it. The recycle waits for the phone to leave the link instead of sleeping 500 ms, with a 2 s limit standing in for that event in case Windows keeps a client. The drain before the switch takes what the duplex already holds instead of waiting 200 ms for more (Linux too). The 5 s limit on each indication is replaced by the switch it stood in for: once a session moves to its upgraded socket, its remaining packets go out without waiting on confirmations the phone has stopped sending. The 3 s and 10 s drain limits now end on the link dropping, the 45 s first-byte limit is gone (the phone closing the socket ends the copy), and the ConnectionConfirm retries end with the session instead of after 5.
Closes #60