Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

ShellStream: Add ReadAsync implementation #187

Merged
merged 1 commit into from
May 28, 2020

Conversation

qmfrederik
Copy link
Contributor

We encourage asynchronously executing a command on the device using AdbClient.ExecuteRemoteCommandAsync.

However, this will then use a ShellStream which only supports synchronous reading data off the stream.

Additionally, to support cancellation, AdbClient.ExecuteRemoteCommandAsync will invoke cancellationToken.Register(() => socket.Dispose()).

However, on Unix, calling socket.Dispose will not unblock synchronous calls for current versions of .NET Core. (This is fixed in .NET 5.0). dotnet/corefx#38804 has the details.

As a result, cancellation of ExecuteRemoteCommandAsync methods is effectively impossible.

This PR implements aynchronous methods in ShellStream, making the scenario work.

@qmfrederik qmfrederik merged commit 17e072e into master May 28, 2020
@qmfrederik qmfrederik deleted the features/shellstream-async branch May 28, 2020 18:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant