Symbiont bitcoin calculator

How to wait for async method to complete? My application uses the excellent Generic HID library v6. 0 which can be found here. When my code drops out of the while loop, I need to read some data from the device. Can anyone clarify the behavior that I’m seeing? Have your methods return Task instead of void.

I was scratching my head on a similar issue and the difference was to change void to Task just as you had said. It’s a minor thing, but to follow the convention both methods should have Async added to their names, e. The most important thing to know about async and await is that await doesn’t wait for the associated call to complete. For pedagogical use only: in general, don’t do this! The answer at “await” doesn’t wait for the completion of call has several, more detailed, explanations of these keywords. Stephen Cleary’s guidance about async void holds. Richard Cook – thank you very much for the additional explanation!