Merged
Conversation
Contributor
Author
|
@surban Whats the status on this? Do you need anything from me to get this moving? |
Collaborator
|
No time for review yet. I hope next week. |
Contributor
Author
|
@surban Whats the status on this? Do I need to do anymore work on this to get it merged? I'm not sure about what to do with the |
Contributor
Author
|
@surban Whats the status on this? |
surban
approved these changes
Jun 6, 2025
Collaborator
|
Looks good. Thanks! |
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.
GATT communication with bluetoothd happens over a
SOCK_SEQPACKETsocket, however bluer usesUnixStreamsocket for those sockets, this leads to issues with tokio/mio/epoll, when receiving notification data from from a remote GATT characteristic. The problem works as follows:UnixStreamsocket into epoll using edge trigger mode.epoll_wait, as there has been more new events since last epoll the application is woken immediately to process the second event.epoll_waitthis time it will not get woken again, even if there are still events to process, as there are no NEW events since last epoll. The application will only receive the next event when an additional new event is received, however this new event will remain in the queue and not be processed.This happens because tokio/mio assumes that on a
UnixStreamsocket there is no more data available if the read does not fill the whole buffer. However the correct thing to do on aSOCK_SEQPACKETsocket is to read from the socket until it returns EAGAIN processing every packet in the queue.This is what
UnixDatagramsocket does.This pull request uses
UnixDatagramsockets instead ofUnixStreamsockets for GATT Characteristic communication.