ReceiveAsync method on DeviceClient to take in a cancellation token
ReceiveAsync method on DeviceClient currently takes in a TimeSpan value. It will be convenient if it can take in a cancellation token to stop listening for commands when the token is triggered.
Taylor Southwick commented
Using a timespan assumes you know how long you want to wait. However, using a cancellation token allows you to at some later point decide you don't want the async operation to continue. With using a time out, I end up having to wait longer than I should (or retrying multiple times) while if you accept a cancellation token, you can always pass a token in that cancels after a certain amount of time; that is, you can have the same functionality as is currently had while using a cancellation token, but you cannot mimic the cancellation token functionality with a time out.