0
我使用AsyncHttpClient通過代理服務器發出HTTP請求,但似乎連接超時不起作用,即使我將其配置爲65秒(代理可以工作得非常慢)。AsyncHttpClient連接超時不起作用
我收到java.util.concurrent.ExecutionException
由java.net.ConnectException
支持(即應用程序不要等到代理服務器返回響應)後0-20秒
Integer timeout = 65000 // 65 secs
AsyncHttpClientConfig cfg = new AsyncHttpClientConfig.Builder().
setConnectTimeout(timeout).
setRequestTimeout(timeout).
setAcceptAnyCertificate(true).
setUserAgent(userAgent).
setProxyServer(new ProxyServer(proxy.ip, proxy.port)).
build()
AsyncHttpClient client = new AsyncHttpClient(cfg)
Response response = client.prepareGet(url).execute().get()
你能發佈錯誤嗎? – talex
爲Ning添加標籤,更新標題以反映標籤以及修正拼寫和標點問題。 –