public class OkHttpDnsClientBuilder extends Object implements OkHttpClientBuilder
大部分代码拷贝自:DefaultOkHttpClientBuilder
限定符和类型 | 方法和说明 |
---|---|
OkHttpClientBuilder |
addInterceptor(okhttp3.Interceptor interceptor)
拦截器
|
OkHttpClientBuilder |
authenticator(okhttp3.Authenticator authenticator)
授权
|
okhttp3.OkHttpClient |
build()
构建OkHttpClient实例.
|
OkHttpClientBuilder |
callTimeout(Long timeout,
TimeUnit unit)
完整的请求过程超时时间
|
OkHttpClientBuilder |
connectTimeout(Long timeout,
TimeUnit unit)
连接建立的超时时间
|
static OkHttpDnsClientBuilder |
get() |
okhttp3.Dns |
getDns() |
OkHttpClientBuilder |
proxy(Proxy proxy)
代理
|
OkHttpClientBuilder |
readTimeout(Long timeout,
TimeUnit unit)
连接的IO读操作超时时间
|
OkHttpClientBuilder |
setConnectionPool(okhttp3.ConnectionPool connectionPool)
连接池
|
OkHttpClientBuilder |
setDispatcher(okhttp3.Dispatcher dispatcher)
请求调度管理
|
void |
setDns(okhttp3.Dns dns) |
OkHttpClientBuilder |
setEventListenerFactory(okhttp3.EventListener.Factory eventListenerFactory)
监听网络请求过程
|
OkHttpClientBuilder |
setFollowRedirects(Boolean followRedirects)
是否允许重定向操作
|
OkHttpClientBuilder |
setPingInterval(Integer pingInterval)
ping的时间间隔
|
OkHttpClientBuilder |
setRetryOnConnectionFailure(Boolean retryOnConnectionFailure)
是否支持失败重连
|
OkHttpClientBuilder |
writeTimeout(Long timeout,
TimeUnit unit)
连接的IO写操作超时时间
|
public static OkHttpDnsClientBuilder get()
public okhttp3.Dns getDns()
public void setDns(okhttp3.Dns dns)
public okhttp3.OkHttpClient build()
OkHttpClientBuilder
build
在接口中 OkHttpClientBuilder
public OkHttpClientBuilder proxy(Proxy proxy)
OkHttpClientBuilder
proxy
在接口中 OkHttpClientBuilder
proxy
- Proxypublic OkHttpClientBuilder authenticator(okhttp3.Authenticator authenticator)
OkHttpClientBuilder
authenticator
在接口中 OkHttpClientBuilder
authenticator
- Authenticatorpublic OkHttpClientBuilder addInterceptor(okhttp3.Interceptor interceptor)
OkHttpClientBuilder
addInterceptor
在接口中 OkHttpClientBuilder
interceptor
- Interceptorpublic OkHttpClientBuilder setDispatcher(okhttp3.Dispatcher dispatcher)
OkHttpClientBuilder
setDispatcher
在接口中 OkHttpClientBuilder
dispatcher
- Dispatcherpublic OkHttpClientBuilder setConnectionPool(okhttp3.ConnectionPool connectionPool)
OkHttpClientBuilder
setConnectionPool
在接口中 OkHttpClientBuilder
connectionPool
- ConnectionPoolpublic OkHttpClientBuilder setEventListenerFactory(okhttp3.EventListener.Factory eventListenerFactory)
OkHttpClientBuilder
setEventListenerFactory
在接口中 OkHttpClientBuilder
eventListenerFactory
- EventListenerpublic OkHttpClientBuilder setRetryOnConnectionFailure(Boolean retryOnConnectionFailure)
OkHttpClientBuilder
setRetryOnConnectionFailure
在接口中 OkHttpClientBuilder
retryOnConnectionFailure
- retryOnConnectionFailurepublic OkHttpClientBuilder setFollowRedirects(Boolean followRedirects)
OkHttpClientBuilder
setFollowRedirects
在接口中 OkHttpClientBuilder
followRedirects
- followRedirectspublic OkHttpClientBuilder connectTimeout(Long timeout, TimeUnit unit)
OkHttpClientBuilder
connectTimeout
在接口中 OkHttpClientBuilder
timeout
- 时长unit
- 时间单位public OkHttpClientBuilder callTimeout(Long timeout, TimeUnit unit)
OkHttpClientBuilder
callTimeout
在接口中 OkHttpClientBuilder
timeout
- 时长unit
- 时间单位public OkHttpClientBuilder readTimeout(Long timeout, TimeUnit unit)
OkHttpClientBuilder
readTimeout
在接口中 OkHttpClientBuilder
timeout
- 时长unit
- 时间单位public OkHttpClientBuilder writeTimeout(Long timeout, TimeUnit unit)
OkHttpClientBuilder
writeTimeout
在接口中 OkHttpClientBuilder
timeout
- 时长unit
- 时间单位public OkHttpClientBuilder setPingInterval(Integer pingInterval)
OkHttpClientBuilder
setPingInterval
在接口中 OkHttpClientBuilder
pingInterval
- ping的时间间隔Copyright © 2024. All rights reserved.