Cancelling a read operation
See original GitHub issueI’m not sure if this is caused by Kable or the Android platform. If I cancel a coroutine while it’s running a read operation, any attempt to read afterwards immediately fails with a GattRequestRejectedException
(message
is null
). This lasts until I restart the connection. I haven’t dared to test the same thing with a write operation 😅
Is this the expected behavior, or a bug in Kable?
My use case is I am reading a characteristic periodically while a specific page is showing, and I want to cancel that polling when navigating away from that page, while keeping the connection open for the next page.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
boost asio cancelling read without cancelling write
I have a socket that both waits for data and tries to send some as well(async_read / async_write), at some point I'd like...
Read more >Cancelable Reads in Go - Ben Congdon
As mentioned above, Close() can be used as a mechanism to cancel a pending Read() . However, there are still some cases where...
Read more >Canceling Pending I/O Operations - Win32 apps
You can cancel asynchronous I/O from any thread in the process that issued the I/O operation. You must specify the handle which the...
Read more >Restarting or terminating an ALLOW READ ACCESS load ...
If a load operation in ALLOW READ ACCESS mode is interrupted or cancelled in the load phase, it restarts in the load phase....
Read more >Canceling MySQL Queries in Go - Medium
The key to canceling a read operation is to obtain an exclusive connection from the pool. // Obtain an exclusive connection conn, err...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Apologies I haven’t gotten to this yet. Been swamped while working on another project. I’m hoping the project finishes up soon, and that I’ll get some time to focus back on Kable.
Hi @twyatt, thanks for looking into this. I’ve done some initial testing, and it looks like my issue is solved with this fix! I will need to get hold of some devices to verify that my original issue has been solved, but this looks promising.
Thank you!