Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect native HttpHandler on Android #1927

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Oct 27, 2022

Android uses a native HTTP handler if HttpClientHandler is specified. The native HTTP handler doesn't have enough HTTP/2 support for gRPC and can cause errors. Example: #1923. We want Android to always use SocketsHttpHandler.

Detect if a native HttpHandler is being used on Android, and throw a friendly error message on Android if necessary.

Doc at https://aka.ms/aspnet/grpc/android will be added soon.

{
// Validate the user specified handler is compatible with this platform.
//
// Android's native handler doesn't fully support HTTP/2 and using it could cause hard to understand errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the native handler works for some cases? And what if the native handler improves in the future to have better support? Should there be a switch to ignore this check and allow using the native handler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought is if that happens, the grpc-dotnet client can be updated to detect the Android OS version that fully supports gRPC, and not throw this error.

@JamesNK JamesNK force-pushed the jamesnk/android-validate-handler branch from b735e5d to 8b9a895 Compare November 1, 2022 07:26
@JamesNK JamesNK merged commit 7154cb4 into grpc:master Nov 1, 2022
@JamesNK JamesNK deleted the jamesnk/android-validate-handler branch November 1, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants