private void applyConnectionParams ( final HttpMethod method ) throws IOException { int timeout = 0 ; // see if a timeout is given for this method Object param = method . getParams ( ) . getParameter ( HttpMethodParams . SO_TIMEOUT ) ; if ( param == null ) { // if not, use the default value param = this . conn . getParams ( ) . getParameter ( HttpConnectionParams . SO_TIMEOUT ) ; } if ( param != null ) { timeout = ( ( Integer ) param ) . intValue ( ) ; } this . conn . setSocketTimeout ( timeout ) ; }
Applies connection parameters specified for a given method