//设置超时
// This enables the user to pass in socket timeout value as an Integer. If nothing is set, the default value is 60000 milliseconds.
options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(600000));
// This enables the user to pass in connection timeout value as an Integer. If nothing is set, the default value is 60000 milliseconds.
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(600000));
options.setTimeOutInMilliSeconds(600000L);
原文:http://www.blogjava.net/pzxsheng/archive/2014/11/24/420523.html