ITeye博客

HttpClient 4 必须设超时时间,否则线程一直等在那.

kong6001 · 2014-06-08 11:20 · HttpClient · 编程语言 · Markdown

// Note: must set timeout,otherwise alway wait here.

        // set time out

        // conntction timeout 20s

        httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 20000);

        // transfer time 60s

        httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 60000);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。