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

AndroidClientHandler code is not structured well enough to override anything #3059

Closed
sdebruyn opened this issue May 2, 2019 · 2 comments
Closed
Assignees
Labels
Area: App Runtime Issues in `libmonodroid.so`. enhancement Proposed change to current functionality.

Comments

@sdebruyn
Copy link
Contributor

sdebruyn commented May 2, 2019

I tried to override a method to fix #3058

As soon as you copy this method over and try to change the line with the issue, you notice a lot of errors leading to private methods, properties or fields. When you copy over these methods from the source, you notice another bunch of errors with the same cause. Overriding this single method (I know, it's the most crucial one) leads me to copying all the files inside the Xamarin.Android.Net folder.

IMHO this class should be restructured so that it's a lot easier for inheritors to override some parts of it.

@jonathanpeppers
Copy link
Member

@SamuelDeBruyn can you post a simple C# code example of what you might want to override?

@jonathanpeppers jonathanpeppers added the enhancement Proposed change to current functionality. label May 3, 2019
@grendello grendello added Area: App Runtime Issues in `libmonodroid.so`. need-info Issues that need more information from the author. and removed need-info Issues that need more information from the author. labels May 6, 2019
@grendello
Copy link
Contributor

Hi @SamuelDeBruyn,

This class was never meant to be extensible by the user to the degree above what's absolutely necessary to make the client handler work (e.g. the SSL setup, socket factory etc). It was a deliberate decision as the class is to serve as a drop-in replacement for the default HTTP client handler and there are many quirks to the underlying Java HTTP handling - we didn't want to make it "too easy" to introduce issues. Issue #3058 is a bug in the class and it should be fixed there (as you do in #3060) instead of overriding the default class behavior.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App Runtime Issues in `libmonodroid.so`. enhancement Proposed change to current functionality.
Projects
None yet
Development

No branches or pull requests

3 participants