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
How to cleanly pin a network #8286
Comments
How about this:
And maybe also this:
Plus Do we need to hide these in the |
@swankjesse for discussion in #8376, I think I want to move away from recreating the OkHttpClient instance, and instead configure Dns, SocketFactory and Address matcher? that listen for a Request tag (NetworkPin) that callers or interceptors set. |
Hello, have you solved this problem? |
No, the approach requires a new client. |
WorkManager provides a required network for scheduled jobs with network constraints
https://developer.android.com/reference/androidx/work/WorkerParameters#getNetwork()
Using this specific network is possible with a custom Dns and SocketFactory. However the naive implementation would probably result in defeating connection pooling in some cases.
Is there a supported pattern for this, if Dns and SocketFactory both support equality checks, would pooling be correctly retained?
cc @swankjesse
The text was updated successfully, but these errors were encountered: