HttpClient 3.1超时无效

时间:2016-11-24 14:27:23

标签: java jboss httpclient

我们在JBoss实例中使用HttpClient 3.1,但超时不起作用,由于某些原因,我们将超时设置为5秒(5000毫秒)。

        HttpConnectionManagerParams cmparams = new HttpConnectionManagerParams();
        cmparams.setSoTimeout(timeout);
        cmparams.setConnectionTimeout(timeout);
        cmparams.setTcpNoDelay(true);
        HttpConnectionManager manager = new SimpleHttpConnectionManager();
        manager.setParams(cmparams);
        HttpClientParams params = new HttpClientParams();
        params.setSoTimeout(timeout);
        params.setConnectionManagerTimeout(timeout);
        httpClient = new HttpClient(params, manager);

目前我们在10秒后获得套接字超时。现在有人为什么这不起作用?

由于

0 个答案:

没有答案