question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cancelling a read operation

See original GitHub issue

I’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:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
twyattcommented, Jul 18, 2022

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.

1reaction
johareicommented, Sep 1, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found