简体   繁体   English

OkHttp 支持(和使用)哪些 TCP 拥塞控制算法?

[英]Which TCP Congestion Control Algorighms are supported (and used) by OkHttp?

What is the list of all TCP Congestion Control Algorithms that are utilized by the OkHttp library ? OkHttp 库使用的所有 TCP 拥塞控制算法的列表是什么?

I'm trying to figure out why some FOSS mobile apps fail so miserably in poor network conditions (high packet loss, jitter, latency).我试图弄清楚为什么一些 FOSS 移动应用程序在糟糕的网络条件下(高丢包率、抖动、延迟)会如此悲惨地失败。 But sometimes the devs just wave their hands and say it should be fine because they're using OkHttp.但有时开发人员只是挥手说应该没问题,因为他们使用的是 OkHttp。

While it does appear that OKHttp is designed to minimize bandwidth with caching and do other cool things that translate to better UX, I couldn't find any information in the OkHttp documentation that specified whichTCP Congestion Control Algorithms they're using.虽然看起来 OKHttp 旨在通过缓存最小化带宽并做其他很酷的事情来转化为更好的用户体验,但我在OkHttp 文档中找不到任何信息,说明他们正在使用哪种TCP 拥塞控制算法

For example, how can I tell OkHttp to use BBR ?例如,我如何告诉 OkHttp 使用BBR

TCP behavior including congestion control is fully handled by the OS and the most an application can do is select from the algorithms the OS offers . TCP 行为(包括拥塞控制)完全由操作系统处理,应用程序最多可以做的是来自操作系统提供的算法的 select Most applications don't select anything here but rely on OS defaults.大多数应用程序在这里没有 select 任何东西,而是依赖于操作系统默认值。 And as far as I can see from the source code OkHttp is no different here, ie it simply relies on the OS default.从源代码中我可以看出 OkHttp 在这里没有什么不同,即它只是依赖于操作系统默认值。

I don't think OkHttp can answer this definitively since we just use the JVM networking libraries.我不认为 OkHttp 可以明确回答这个问题,因为我们只使用 JVM 网络库。 We also see very different behaviour on JVM (changing with major releases) and on different Android versions.我们还在 JVM(随主要版本更改)和不同的 Android 版本上看到了非常不同的行为。

So it would be up to whatever the VM chooses.因此,这取决于 VM 的选择。

It uses SocketFactory.getDefault() here https://github.com/square/okhttp/blob/b515117984e198fd710e85005ee7a520e236e3f3/okhttp/src/jvmMain/kotlin/okhttp3/OkHttpClient.kt#L525它在这里使用SocketFactory.getDefault() https://github.com/square/okhttp/blob/b515117984e198fd710e85005ee7a520e236e3f3/okhttp/src/jvmMain/kotlin/okhttp3/OkHttpClient.kt#L525

And then connects here然后在这里连接

https://github.com/square/okhttp/blob/fd6452596c9f8c691b7864e212faf03d7c3bf8d8/okhttp/src/jvmMain/kotlin/okhttp3/internal/connection/ConnectPlan.kt#L241 https://github.com/square/okhttp/blob/fd6452596c9f8c691b7864e212faf03d7c3bf8d8/okhttp/src/jvmMain/kotlin/okhttp3/internal/connection/ConnectPlan.kt#L241

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android日历应用的日期选择中使用了哪个控件 - Which control is being used in the Date Selection of Android Calendar App 当与okhttp一起使用时,图像未与Picasso一起加载 - Images are not loading with picasso when used with okhttp 从 Android N (--min-api 24) 开始支持:okhttp3.Request okhttp3.Authenticator - supported starting with Android N (--min-api 24): okhttp3.Request okhttp3.Authenticator SignalR将在支持Websocket的Android应用程序和IIS服务器之间使用哪种传输? - Which transport will be used by SignalR between android app and IIS server that supported Websocket? Android okHttp-如何识别响应是针对哪个请求的? - Android okHttp - How to identify response is for which request? OKHTTP缓存:如何重写用于缓存的响应的URL? - OKHTTP caching: How to rewrite the URL of the response used for caching? 什么是Cordova Android应用程序中使用的com.squareup.okhttp包 - what is com.squareup.okhttp package used in Cordova Android App 在使用HttpUrlConnection时,在Android设备上使用的okHTTP> 4.4? - okHTTP used internally on android devices >4.4 when using HttpUrlConnection? OkHttp Http2 音频流,我可以控制发送的字节吗? - OkHttp Http2 Audio stream, Can I control sent bytes? 当与Retrofit RxJavaCallAdapterFactory一起使用时,Okhttp会忽略Dispatcher设置 - Okhttp ignores Dispatcher setting when used with Retrofit RxJavaCallAdapterFactory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM