如何为 URL 共享相同地址 (URL) 使用不同的 TCP 套接字连接
How to to use different TCP socket connection for URLs that share the same address (URL)
Okhttp documentation 声明如下:
URLs that share the same address may also share the same underlying TCP socket connection.
我们需要为共享同一地址 (URL) 的 URL 使用不同的 TCP 套接字连接。 okhttp客户端中有没有配置可以实现这个?
OkHttp 还没有 client-side 负载平衡,但有一个 tracking bug 优先。
在此之前,您需要创建多个 OkHttpClients
,每个都有一个不同的 ConnectionPool
实例。这很笨拙,但在负载平衡功能准备就绪之前可能会让您畅通无阻。
Okhttp documentation 声明如下:
URLs that share the same address may also share the same underlying TCP socket connection.
我们需要为共享同一地址 (URL) 的 URL 使用不同的 TCP 套接字连接。 okhttp客户端中有没有配置可以实现这个?
OkHttp 还没有 client-side 负载平衡,但有一个 tracking bug 优先。
在此之前,您需要创建多个 OkHttpClients
,每个都有一个不同的 ConnectionPool
实例。这很笨拙,但在负载平衡功能准备就绪之前可能会让您畅通无阻。