Created
January 31, 2021 00:51
-
-
Save MelbourneDeveloper/e62bf2e542458061bda4356b255bde12 to your computer and use it in GitHub Desktop.
Timeout
This file contains 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
var cancellationTokenSource = new CancellationTokenSource(); | |
//Fire a timeout after 1000 milliseconds | |
cancellationTokenSource.CancelAfter(1000); | |
var result = await device.WriteAndReadAsync(writeData, cancellationTokenSource.Token); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment